-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_place.py
37 lines (26 loc) · 989 Bytes
/
test_place.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
"""(Incomplete) Tests for Place class."""
from Place import Place
def run_tests():
"""Test Place class."""
# Test empty place (defaults)
print("Test empty place:")
default_place = Place("Townsville", "Australia", 0, "v")
print(default_place)
assert default_place.name == "Townsville"
assert default_place.country == "Australia"
assert default_place.priority == 0
assert default_place.is_visited
# Test initial-value place
print("Test initial-value place:")
new_place = Place("Malagar", "Spain", 2, False)
# TODO: Write tests to show this initialisation works
print(new_place)
print(new_place.name)
print(new_place.country)
print(new_place.priority)
print(new_place.visited)
print(f"Dict: {new_place.__dict__}")
# TODO: Add more tests, as appropriate, for each method
print("Is important: {}".format(new_place.is_important()))
print("Visited? {}".format(new_place.is_visited()))
run_tests()