diff options
author | Prefetch | 2022-12-31 22:21:39 +0100 |
---|---|---|
committer | Prefetch | 2022-12-31 22:21:39 +0100 |
commit | 68615a9ad2c942254135cffb00cf25a84a3b1356 (patch) | |
tree | 1ed3131f673207b2ef0bdaee3ee98bb68d6640ca /13/test.py |
Initial commit
Diffstat (limited to '13/test.py')
-rwxr-xr-x | 13/test.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/13/test.py b/13/test.py new file mode 100755 index 0000000..7600159 --- /dev/null +++ b/13/test.py @@ -0,0 +1,30 @@ +#!/usr/bin/python + +import unittest + +import main + + + +class ExamplesPart1(unittest.TestCase): + def test_example1(self): + lines = [ + "Alice would gain 54 happiness units by sitting next to Bob.", + "Alice would lose 79 happiness units by sitting next to Carol.", + "Alice would lose 2 happiness units by sitting next to David.", + "Bob would gain 83 happiness units by sitting next to Alice.", + "Bob would lose 7 happiness units by sitting next to Carol.", + "Bob would lose 63 happiness units by sitting next to David.", + "Carol would lose 62 happiness units by sitting next to Alice.", + "Carol would gain 60 happiness units by sitting next to Bob.", + "Carol would gain 55 happiness units by sitting next to David.", + "David would gain 46 happiness units by sitting next to Alice.", + "David would lose 7 happiness units by sitting next to Bob.", + "David would gain 41 happiness units by sitting next to Carol." + ] + self.assertEqual(main.solve_part1(lines), 330) + + + +if __name__ == "__main__": + unittest.main() |