4
4
import os
5
5
from subprocess import getoutput
6
6
7
- prg = './ picnic.py'
7
+ prg = " picnic.py"
8
8
9
9
10
10
# --------------------------------------------------
@@ -18,51 +18,52 @@ def test_exists():
18
18
def test_usage ():
19
19
"""usage"""
20
20
21
- for flag in ['' , '-h' , ' --help' ]:
22
- out = getoutput (f' { prg } { flag } ' )
23
- assert out .lower ().startswith (' usage' )
21
+ for flag in ["" , "-h" , " --help" ]:
22
+ out = getoutput (f" { prg } { flag } " )
23
+ assert out .lower ().startswith (" usage" )
24
24
25
25
26
26
# --------------------------------------------------
27
27
def test_one ():
28
28
"""one item"""
29
29
30
- out = getoutput (f' { prg } chips' )
31
- assert out .strip () == ' You are bringing chips.'
30
+ out = getoutput (f" { prg } chips" )
31
+ assert out .strip () == " You are bringing chips."
32
32
33
33
34
34
# --------------------------------------------------
35
35
def test_two ():
36
36
"""two items"""
37
37
38
38
out = getoutput (f'{ prg } soda "french fries"' )
39
- assert out .strip () == ' You are bringing soda and french fries.'
39
+ assert out .strip () == " You are bringing soda and french fries."
40
40
41
41
42
42
# --------------------------------------------------
43
43
def test_more_than_two ():
44
44
"""more than two items"""
45
45
46
46
arg = '"potato chips" coleslaw cupcakes "French silk pie"'
47
- out = getoutput (f'{ prg } { arg } ' )
48
- expected = ('You are bringing potato chips, coleslaw, '
49
- 'cupcakes, and French silk pie.' )
47
+ out = getoutput (f"{ prg } { arg } " )
48
+ expected = (
49
+ "You are bringing potato chips, coleslaw, " "cupcakes, and French silk pie."
50
+ )
50
51
assert out .strip () == expected
51
52
52
53
53
54
# --------------------------------------------------
54
55
def test_two_sorted ():
55
56
"""two items sorted output"""
56
57
57
- out = getoutput (f' { prg } -s soda candy' )
58
- assert out .strip () == ' You are bringing candy and soda.'
58
+ out = getoutput (f" { prg } -s soda candy" )
59
+ assert out .strip () == " You are bringing candy and soda."
59
60
60
61
61
62
# --------------------------------------------------
62
63
def test_more_than_two_sorted ():
63
64
"""more than two items sorted output"""
64
65
65
- arg = ' bananas apples dates cherries'
66
- out = getoutput (f' { prg } { arg } --sorted' )
67
- expected = ( ' You are bringing apples, bananas, cherries, and dates.' )
66
+ arg = " bananas apples dates cherries"
67
+ out = getoutput (f" { prg } { arg } --sorted" )
68
+ expected = " You are bringing apples, bananas, cherries, and dates."
68
69
assert out .strip () == expected
0 commit comments