diff options
Diffstat (limited to 'day18/test_init.py')
| -rw-r--r-- | day18/test_init.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/day18/test_init.py b/day18/test_init.py new file mode 100644 index 0000000..f8a4eaa --- /dev/null +++ b/day18/test_init.py | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | from aoc.datastructures import Coordinate3 | ||
| 3 | from day18 import Assignment | ||
| 4 | |||
| 5 | |||
| 6 | class TestAssignment: | ||
| 7 | def test_open_sides(self): | ||
| 8 | blocks = {Coordinate3(0, 0, 0)} | ||
| 9 | |||
| 10 | assert Assignment.open_sides(blocks) == 6 | ||
| 11 | |||
| 12 | blocks = { | ||
| 13 | Coordinate3(0, 0, 0), | ||
| 14 | Coordinate3(1, 0, 0), | ||
| 15 | } | ||
| 16 | |||
| 17 | assert Assignment.open_sides(blocks) == 10 | ||
| 18 | |||
| 19 | blocks = { | ||
| 20 | Coordinate3(1, 1, 1), | ||
| 21 | Coordinate3(2, 1, 1), | ||
| 22 | } | ||
| 23 | |||
| 24 | assert Assignment.open_sides(blocks) == 10 | ||
