summaryrefslogtreecommitdiff
path: root/02/test.py
diff options
context:
space:
mode:
Diffstat (limited to '02/test.py')
-rwxr-xr-x02/test.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/02/test.py b/02/test.py
new file mode 100755
index 0000000..965adef
--- /dev/null
+++ b/02/test.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+import unittest
+
+import main
+
+
+
+class ExamplesPart1(unittest.TestCase):
+ def test_example1(self):
+ boxes = [(2, 3, 4)]
+ self.assertEqual(main.solve_part1(boxes), 58)
+
+ def test_example2(self):
+ boxes = [(1, 1, 10)]
+ self.assertEqual(main.solve_part1(boxes), 43)
+
+
+
+class ExamplesPart2(unittest.TestCase):
+ def test_example1(self):
+ boxes = [(2, 3, 4)]
+ self.assertEqual(main.solve_part2(boxes), 34)
+
+ def test_example2(self):
+ boxes = [(1, 1, 10)]
+ self.assertEqual(main.solve_part2(boxes), 14)
+
+
+
+if __name__ == "__main__":
+ unittest.main()