Beispiel #1
0
 def setUp(self):
     self.rows = parse_content(TEST_INPUT)
Beispiel #2
0
 def setUp(self):
     self.passwords = parse_content(TEST_INPUT)
Beispiel #3
0
 def setUp(self):
     self.trees = parse_content(TEST_INPUT)
Beispiel #4
0
 def setUp(self):
     self.numbers = parse_content(TEST_INPUT)
Beispiel #5
0
 def setUp(self):
     self.course = parse_content(TEST_INPUT)
Beispiel #6
0
 def setUp(self):
     self.program = parse_content(TEST_INPUT)
Beispiel #7
0
    def test_second_count_all_bags_in_bag(self):
        bags = parse_content(TEST_INPUT_2)
        bags = compute_children_and_parents(bags)

        self.assertEqual(count_all_bags_in_bag(bags["shiny gold"]), 126)
Beispiel #8
0
 def setUp(self):
     self.seats = parse_content(TEST_INPUT)
Beispiel #9
0
 def setUp(self):
     self.passports = parse_content(TEST_INPUT)
Beispiel #10
0
    def test_count_all_parents_of_shiny_gold_bag(self):
        bags = parse_content(TEST_INPUT_1)
        bags = compute_children_and_parents(bags)

        self.assertEqual(len(get_parents_of_bag(bags["shiny gold"])), 4)
Beispiel #11
0
 def setUp(self):
     self.groups = parse_content(TEST_INPUT)
Beispiel #12
0
    def test_count_second_arrangements(self):
        adapters = parse_content(TEST_INPUT_2)

        self.assertEqual(count_arrangements(adapters), 19208)
Beispiel #13
0
    def test_count_first_arrangements(self):
        adapters = parse_content(TEST_INPUT_1)

        self.assertEqual(count_arrangements(adapters), 8)
Beispiel #14
0
    def test_count_second_differences(self):
        adapters = parse_content(TEST_INPUT_2)
        one, _, three = count_differences(adapters)

        self.assertEqual(one * three, 22 * 10)
Beispiel #15
0
    def test_count_first_differences(self):
        adapters = parse_content(TEST_INPUT_1)
        one, _, three = count_differences(adapters)

        self.assertEqual(one * three, 7 * 5)