@@ -9,53 +9,54 @@ def exists():
9
9
10
10
@check50 .check (exists )
11
11
def test_correct_input ():
12
- """correctly accepts two command-line inputs"""
12
+ """tasks.py correctly accepts two command-line inputs"""
13
13
check50 .run ("python3 tasks.py" ).exit (code = 1 )
14
14
15
+ @check50 .check (exists )
16
+ def test_simple_add ():
17
+ """tasks.py correctly handles simple add case"""
18
+ output = "1. Attend Lecture\n 2. Rip a Phonebook\n 3. Eat"
19
+ check50 .run ("python3 tasks.py monday.txt" ).stdin ("add Eat" , prompt = True ).stdout (regex (output ), output ).kill ()
20
+
15
21
@check50 .check (exists )
16
22
def test_print_add ():
17
- """correctly prints added task"""
23
+ """tasks.py correctly prints added task"""
18
24
output = "1. Attend Lecture\n 2. Rip a Phonebook\n 3. Call David"
19
25
check50 .run ("python3 tasks.py monday.txt" ).stdin ("add Call David" , prompt = True ).stdout (regex (output ), output ).kill ()
20
26
21
27
@check50 .check (exists )
22
28
def test_case_add ():
23
- """disregards the case of add"""
29
+ """tasks.py correctly handles case-sensitive add"""
24
30
output = "1. Attend Lecture\n 2. Rip a Phonebook\n 3. Call David"
25
31
check50 .run ("python3 tasks.py monday.txt" ).stdin ("aDd Call David" , prompt = True ).stdout (regex (output ), output ).kill ()
26
32
27
- @check50 .check (exists )
28
- def test_add_txt ():
29
- """test"""
30
- check50 .run ("python3 testing.py get_level" )
31
-
32
33
@check50 .check (exists )
33
34
def test_print_remove ():
34
- """correctly prints list after removal"""
35
+ """tasks.py correctly prints list after removal"""
35
36
output = "1. Rip a Phonebook"
36
37
check50 .run ("python3 tasks.py monday.txt" ).stdin ("remove Attend Lecture" , prompt = True ).stdout (regex (output ), output ).kill ()
37
38
38
39
@check50 .check (exists )
39
40
def test_case_remove ():
40
- """disregards the case of remove"""
41
+ """tasks.py correctly handles case-sensitive remove"""
41
42
output = "1. Rip a Phonebook"
42
43
check50 .run ("python3 tasks.py monday.txt" ).stdin ("rEMoVe Attend Lecture" , prompt = True ).stdout (regex (output ), output ).kill ()
43
44
44
45
@check50 .check (exists )
45
46
def test_invalid_remove ():
46
- """correctly exits when no match to remove"""
47
+ """tasks.py correctly exits when no match to remove"""
47
48
check50 .run ("python3 tasks.py monday.txt" ).stdin ("remove Feed the Cat" , prompt = True ).exit (code = 1 )
48
49
49
50
@check50 .check (exists )
50
51
def test_just_command ():
51
- """correctly exits when no description """
52
+ """tasks.py correctly exits when no task is given """
52
53
check50 .run ("python3 tasks.py monday.txt" ).stdin ("add" , prompt = True ).exit (code = 1 )
53
54
54
55
@check50 .check (exists )
55
56
def test_invalid_command ():
56
- """correctly exits when invalid command """
57
+ """tasks.py correctly exits when invalid operation """
57
58
check50 .run ("python3 tasks.py monday.txt" ).stdin ("edit Rip a Phonebook" , prompt = True ).exit (code = 1 )
58
59
59
60
def regex (text ):
60
61
"""match case-sensitively with any characters on either side"""
61
- return rf"^.*{ escape (text )} .*$"
62
+ return rf"^.*{ escape (text )} .*$"
0 commit comments