-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_notes50.py
70 lines (57 loc) · 1.74 KB
/
test_notes50.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from project import parse_args, note, pset
tNotes = {
"a": 0,
"g": 0,
"p": 0,
"w": 0,
"x": 0,
}
tPsets = {
"a": "0/degrees",
"g": "0/pong",
"p": "0/indoor",
"w": "0/search",
"x": "0/scratch",
}
tProjects = {
"g": "project",
"p": "project",
"w": "project",
"x": "project",
}
def test_notes():
for key, value in tNotes.items():
args = parse_args([f"-{key}", value])
for i in vars(args):
if f"{getattr(args, i)}".isnumeric():
with open("tests/temp.md", "w+")as t:
t.write(note(args, i))
with open(f"./tests/{key}/{value}.md") as f:
with open("tests/temp.md") as t:
print(key, value)
assert t.read() == f.read()
def test_psets():
for key, value in tPsets.items():
args = parse_args([f"-{key}", value])
for i in vars(args):
if f"{getattr(args, i)}".isnumeric():
with open("tests/temp.md", "w+")as t:
t.write(pset(args, i))
with open(f"./tests/{key}/{value}.md") as f:
with open("temp.md") as t:
assert t.read() == f.read()
def test_projects():
for key, value in tProjects.items():
args = parse_args([f"-{key}", value])
for i in vars(args):
if f"{getattr(args, i)}".isnumeric():
with open("tests/temp.md", "w+")as t:
t.write(pset(args, i))
with open(f"./tests/{key}/{value}.md") as f:
with open("temp.md") as t:
assert t.read() == f.read()
def main():
test_notes()
test_projects()
test_psets()
main()