Commit e85a832d authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

TEST: Regression test - use of --variable and --visit

parent 9df5e487
......@@ -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'])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment