|
6 | 6 | def test_jqlcomposer_main_asfile(): |
7 | 7 | for i in range(len(TEST_TERMS)): |
8 | 8 | idx = i+1 |
9 | | - with open(f"testout{idx}.txt", "w") as outfile: |
10 | | - subprocess.run(["python", "src/jqlcomposer.py", TEST_TERMS[i], "--filename", f"test{idx}.json"], stdout=outfile) |
11 | | - assert 0 == filecmp.cmp(f"testout{idx}.txt", f"expect{idx}.txt") |
| 9 | + with open(f"tests/testout{idx}.txt", "w") as outfile: |
| 10 | + subprocess.run(["python", "src/jqlcomposer.py", TEST_TERMS[i], "--filename", f"tests/test{idx}.json"], stdout=outfile) |
| 11 | + assert 0 == filecmp.cmp(f"tests/testout{idx}.txt", f"tests/expect{idx}.txt") |
12 | 12 |
|
13 | 13 | def test_jqlcomposer_main_astext(): |
14 | 14 | for i in range(len(TEST_TERMS)): |
15 | 15 | idx = i+1 |
16 | 16 | json_contents = "" |
17 | | - with open(f"test{idx}.json", "r") as infile: |
| 17 | + with open(f"tests/test{idx}.json", "r") as infile: |
18 | 18 | json_contents = infile.read() |
19 | | - with open(f"testout{idx}.txt", "w") as outfile: |
| 19 | + with open(f"tests/testout{idx}.txt", "w") as outfile: |
20 | 20 | subprocess.run(["python", "src/jqlcomposer.py", TEST_TERMS[i], f'"{json_contents}"'], stdout=outfile) |
21 | | - assert 0 == filecmp.cmp(f"testout{idx}.txt", f"expect{idx}.txt") |
| 21 | + assert 0 == filecmp.cmp(f"tests/testout{idx}.txt", f"tests/expect{idx}.txt") |
22 | 22 |
|
0 commit comments