-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_amon.py
36 lines (31 loc) · 917 Bytes
/
test_amon.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
"""
Unit tests for Amon.
"""
import pytest #pylint: disable=unused-import
from amon import Amon
def test_does_amon_exist():
'''
Test to see if we can sucessfully initiate an instance of Amon with
correct attributes
'''
user = Amon()
assert user.amon_stats == [200, 200, "down", "red"]
def test_out_of_bounds():
'''
Test to see if Amon successfully detects when he is out-of-bounds and
self corrects.
'''
user = Amon()
user.update_x_and_y(300,300)
user.amon_passive_update()
user.amon_passive_update()
assert user.amon_stats == [478, 472, "down", "red"]
def test_in_bounds():
'''
Test to see if Amon sucessfully moves whilst inbounds
'''
user = Amon()
user.update_x_and_y(50,50)
user.amon_passive_update()
user.amon_passive_update()
assert user.amon_stats == [250, 250, "down", "red"]