summaryrefslogtreecommitdiffstats
path: root/day1/test_init.py
diff options
context:
space:
mode:
Diffstat (limited to 'day1/test_init.py')
-rw-r--r--day1/test_init.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/day1/test_init.py b/day1/test_init.py
new file mode 100644
index 0000000..a24e272
--- /dev/null
+++ b/day1/test_init.py
@@ -0,0 +1,38 @@
1# -*- coding: utf-8 -*-
2import pytest
3
4from day1 import AssignmentTwo
5
6
7class TestAssignmentTwo:
8 data = [
9 # Example Data
10 (50, -68, 82, 1),
11 (82, -30, 52, 0),
12 (52, 48, 0, 1),
13 (0, -5, 95, 0),
14 (95, 60, 55, 1),
15 (55, -55, 0, 1),
16 (0, -1, 99, 0),
17 (99, -99, 0, 1),
18 (0, 14, 14, 0),
19 (14, -82, 32, 1),
20 # Additional cases
21 (0, 10, 10, 0),
22 (0, -10, 90, 0),
23 (0, 100, 0, 1),
24 (0, -100, 0, 1),
25 (80, 40, 20, 1),
26 (80, 140, 20, 2),
27 (80, 100, 80, 1),
28 (0, -300, 0, 3),
29 (0, 299, 99, 2),
30 (0, -299, 1, 2),
31 ]
32
33 @pytest.mark.parametrize("position,rotation,new_position,seen_0", data)
34 def test_calculate_new_position(self, position, rotation, new_position, seen_0):
35 assert AssignmentTwo.calculate_new_position(position, rotation) == (
36 new_position,
37 seen_0,
38 )