diff options
| author | 2022-12-12 10:49:04 +0100 | |
|---|---|---|
| committer | 2022-12-12 10:49:04 +0100 | |
| commit | 126a628b171e2a7d2490290185ab21990b0d9698 (patch) | |
| tree | bce90696bbc1ed94f96f162f141e36b61a13b5b5 /day12/test_init.py | |
| parent | 0af1b042a29811bc5c850267681dc45469981845 (diff) | |
| download | 2022-126a628b171e2a7d2490290185ab21990b0d9698.tar.gz 2022-126a628b171e2a7d2490290185ab21990b0d9698.tar.bz2 2022-126a628b171e2a7d2490290185ab21990b0d9698.zip | |
Day12 [Wip]
Diffstat (limited to 'day12/test_init.py')
| -rw-r--r-- | day12/test_init.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/day12/test_init.py b/day12/test_init.py new file mode 100644 index 0000000..f721d56 --- /dev/null +++ b/day12/test_init.py | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | # -*- coding: utf-8 -*- | ||
| 2 | from day12 import Map | ||
| 3 | |||
| 4 | |||
| 5 | class TestMap: | ||
| 6 | def test_neighbours(self): | ||
| 7 | |||
| 8 | map_input = ["".join([str(i) for i in range(8)]) for _ in range(5)] | ||
| 9 | |||
| 10 | map = Map(map=map_input) | ||
| 11 | |||
| 12 | assert set(map.neighbours(0, 0)) == { | ||
| 13 | (0, 1), | ||
| 14 | (1, 0), | ||
| 15 | } | ||
| 16 | |||
| 17 | assert set(map.neighbours(0, 4)) == { | ||
| 18 | (0, 3), | ||
| 19 | (1, 4), | ||
| 20 | } | ||
| 21 | |||
| 22 | assert set(map.neighbours(1, 1)) == { | ||
| 23 | (0, 1), | ||
| 24 | (1, 0), | ||
| 25 | (1, 2), | ||
| 26 | (2, 1), | ||
| 27 | } | ||
