def test_RuleGenerator(self): solver = AoC() solver.data = ["class: 1-3 or 5-7\nrow: 6-11 or 33-44\nseat: 13-40 or 45-50"] solver.generateData() self.assertEqual(3, len(solver.rules))
def test_Task2(self): solver = AoC() solver.data = ["class: 0-1 or 4-19\nrow: 0-5 or 8-19\nseat: 0-13 or 16-19", "nearby tickets:\n3,9,18\n15,1,5\n5,14,9"] solver.generateData() result = solver.Task2()
def test_Task1(self): solver = AoC() solver.data = ["class: 1-3 or 5-7\nrow: 6-11 or 33-44\nseat: 13-40 or 45-50", "nearby tickets:\n7,3,47\n40,4,50\n55,2,20\n38,6,12"] solver.generateData() result = solver.Task1() self.assertEqual(71, result)
def test_TicketGenerator(self): solver = AoC() solver.data = ["nearby tickets:\n7,3,47\n40,4,50\n55,2,20\n38,6,12"] solver.generateData() self.assertEqual(4, len(solver.nearbyTickets))
def test_Task1(self): solver = AoC() solver.data = [".#.", "..#", "###"] solver.generateData() result = solver.Task1(6) self.assertEqual(112, result)
def test_Datagenerator(self): solver = AoC() solver.data = [".#.", "..#", "###"] solver.generateData() self.assertEqual(27, len(solver.pocket))