summaryrefslogtreecommitdiffstats
path: root/day12/test_init.py
blob: f721d561c4fb2c64176ebf3512da669cd312c95f (plain)
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
# -*- coding: utf-8 -*-
from day12 import Map


class TestMap:
    def test_neighbours(self):

        map_input = ["".join([str(i) for i in range(8)]) for _ in range(5)]

        map = Map(map=map_input)

        assert set(map.neighbours(0, 0)) == {
            (0, 1),
            (1, 0),
        }

        assert set(map.neighbours(0, 4)) == {
            (0, 3),
            (1, 4),
        }

        assert set(map.neighbours(1, 1)) == {
            (0, 1),
            (1, 0),
            (1, 2),
            (2, 1),
        }