Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
funpack
Commits
e85a832d
Commit
e85a832d
authored
Jan 07, 2019
by
Paul McCarthy
🚵
Browse files
TEST: Regression test - use of --variable and --visit
parent
9df5e487
Changes
1
Hide whitespace changes
Inline
Side-by-side
ukbparse/tests/test_main.py
View file @
e85a832d
...
...
@@ -1486,3 +1486,26 @@ def test_main_column_patterns_and_variables():
got
=
pd
.
read_csv
(
'out.txt'
,
delimiter
=
'
\t
'
,
index_col
=
0
)
assert
np
.
all
(
got
.
columns
==
[
'col1'
,
'1-0.0'
,
'3-0.0'
])
@
patch_logging
def
test_main_variables_and_visits
():
data
=
tw
.
dedent
(
"""
id,1-0.0,1-1.0,2-0.0,3-0.0,3-1.0
1,11,110,21,31,310
2,12,120,22,32,320
3,13,130,23,33,330
4,14,140,24,34,340
5,15,150,25,35,350
"""
).
strip
()
with
tempdir
():
with
open
(
'data.txt'
,
'wt'
)
as
f
:
f
.
write
(
data
)
main
.
main
(
'-nb -v 1 -v 3 -vi last out.txt data.txt'
.
split
())
got
=
pd
.
read_csv
(
'out.txt'
,
delimiter
=
'
\t
'
,
index_col
=
0
)
assert
np
.
all
(
got
.
columns
==
[
'1-1.0'
,
'3-1.0'
])
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment