|
8 | 8 | from subprocess import getstatusoutput |
9 | 9 |
|
10 | 10 | prg = './wc.py' |
| 11 | +empty = './inputs/empty.txt' |
| 12 | +one_line = './inputs/one.txt' |
| 13 | +two_lines = './inputs/two.txt' |
11 | 14 | fox = '../inputs/fox.txt' |
12 | 15 | sonnet = '../inputs/sonnet-29.txt' |
13 | 16 |
|
@@ -51,27 +54,27 @@ def test_bad_file(): |
51 | 54 | def test_empty(): |
52 | 55 | """Test on empty""" |
53 | 56 |
|
54 | | - rv, out = getstatusoutput(f'{prg} ./empty.txt') |
| 57 | + rv, out = getstatusoutput(f'{prg} {empty}') |
55 | 58 | assert rv == 0 |
56 | | - assert out.rstrip() == ' 0 0 0 ./empty.txt' |
| 59 | + assert out.rstrip() == ' 0 0 0 ./inputs/empty.txt' |
57 | 60 |
|
58 | 61 |
|
59 | 62 | # -------------------------------------------------- |
60 | 63 | def test_one(): |
61 | 64 | """Test on one""" |
62 | 65 |
|
63 | | - rv, out = getstatusoutput(f'{prg} ./one.txt') |
| 66 | + rv, out = getstatusoutput(f'{prg} {one_line}') |
64 | 67 | assert rv == 0 |
65 | | - assert out.rstrip() == ' 1 1 2 ./one.txt' |
| 68 | + assert out.rstrip() == ' 1 1 2 ./inputs/one.txt' |
66 | 69 |
|
67 | 70 |
|
68 | 71 | # -------------------------------------------------- |
69 | 72 | def test_two(): |
70 | 73 | """Test on two""" |
71 | 74 |
|
72 | | - rv, out = getstatusoutput(f'{prg} ./two.txt') |
| 75 | + rv, out = getstatusoutput(f'{prg} {two_lines}') |
73 | 76 | assert rv == 0 |
74 | | - assert out.rstrip() == ' 2 2 4 ./two.txt' |
| 77 | + assert out.rstrip() == ' 2 2 4 ./inputs/two.txt' |
75 | 78 |
|
76 | 79 |
|
77 | 80 | # -------------------------------------------------- |
|
0 commit comments