def test_answers(self): import os if "day7_TLS_SSL" in os.getcwd(): path = "python/" else: path = "day7_TLS_SSL/python/" self.assertEqual(d7p1.run(path), 118) self.assertEqual(d7p2.run(path), 260)
def test_answers(self): import os if "day4_Shift_cipher" in os.getcwd(): path = "python/" else: path = "day4_Shift_cipher/python/" self.assertEqual(d4p1.run(path)[1], 361724) self.assertEqual(int(d4p2.run(path)[1]), 482)
def test_answers(self): import os if "day2" in os.getcwd(): path = "python/" else: path = "day2_Keypad/python/" self.assertEqual(d2p1.run(path=path), "47978") self.assertEqual(d2p2.run(path=path), "659AD")
def test_answers(self): import os if "day3_Triangles" in os.getcwd(): path = "python/" else: path = "day3_Triangles/python/" self.assertEqual(d3p1.run(path=path), 983) self.assertEqual(d3p2.run(path=path), 1836)
def test_part2(self): input_string = "abc5017308" self.assertEqual(d5p2.hash(input_string), "000008f82") assert_keys = [3231929, 5357525, 5708769, 8036669, 8605828, 8609554, 13666005, 13753421] password, test_keys = d5p2.run("abc") self.assertEqual(password, "05ace8e3") self.assertEqual(len(assert_keys), len(test_keys)) for a,b in zip(test_keys, assert_keys): self.assertEqual(a, b)
def test_answers(self): self.assertEqual(d6p1.run(self.path + "input.txt"), "umejzgdw") self.assertEqual(d6p2.run(self.path + "input.txt"), "aovueakv")
def test_part2(self): self.assertEqual(d6p2.run(self.path + "testinput.txt")[:6], "advent")
def test_answers(self): self.assertEqual(d12p1.run(self.path + "input.txt"), 318020) self.assertEqual(d12p2.run(self.path + "input.txt"), 9227674)
def test_parts(self): self.assertEqual(d12p1.run(self.path + "testinput.txt"), 42) self.assertEqual(d12p2.run(self.path + "testinput.txt"), 42)
def test_answers(self): self.assertEqual(d19p1.run(3004953), 1815603) self.assertEqual(d19p2.run(3004953), 1410630)
def test_answers(self): self.assertEqual(d21p1.run(self.path), "dgfaehcb") self.assertEqual(d21p2.run(self.path), "fdhgacbe")
def test_answers(self): self.assertEqual(d5p1.run("uqwqemis")[0], "1a3099aa") self.assertEqual(d5p2.run("uqwqemis")[0], "694190cd")
def test_answers(self): self.assertEqual(d20p1.run(self.path), 22887907) self.assertEqual(d20p2.run(self.path), 109)
def test_part2_full(self): self.assertEqual(d20p2.run(self.path, "testinput.txt", 2**8), 46)
def test_answers(self): self.assertEqual(d13p1.run(), 90) self.assertEqual(d13p2.run(), 135)
def test_answers(self): self.assertEqual(d24p1.run(self.path + "input.txt"), [430, (1, 7, 3, 6, 5, 2, 4)] ) self.assertEqual(d24p2.run(self.path + "input.txt"), [430, (1, 7, 3, 6, 5, 2, 4)] )
def test_answers(self): self.assertEqual(d15p1.run(self.path + "input.txt"), 376777) self.assertEqual(d15p2.run(self.path + "input.txt"), 3903937)