def setUp(self): self.data = { 100: toggle_doors(generate_doors(100)), 999: toggle_doors(generate_doors(999)) }
def test_generate_doors_1_generates_closed_door(self): result = generate_doors(1) self.assertEqual(result[0].is_open, False)
def test_generate_doors_1000_generates_closed_doors(self): result = generate_doors(1000) for i in range(0, 1000): self.assertEqual(result[i].is_open, False)
def test_generate_doors_1_generates_correct_id_value(self): result = generate_doors(1) self.assertEqual(result[0].id, 1)
def test_generate_doors_1000_generates_correct_id_values(self): result = generate_doors(1000) for i in range(0, 1000): self.assertEqual(result[i].id, i + 1)
def test_generate_doors_1_generates_Door_instance(self): result = generate_doors(1) self.assertEqual(type(result[0]).__name__, "Door")
def test_generate_doors_1000_generates_Door_instances(self): result = generate_doors(1000) for i in range(0, 1000): self.assertEqual(type(result[i]).__name__, "Door")
def test_generate_doors_927_generates_927_instance(self): result = generate_doors(927) self.assertEqual(len(result), 927)
def test_generate_doors_2_generates_2_instance(self): result = generate_doors(2) self.assertEqual(len(result), 2)
def test_generate_doors_1_generates_1_instance(self): result = generate_doors(1) self.assertEqual(len(result), 1)
def test_collect_open_doors_10_toggled(self): result = collect_open_doors(toggle_doors(generate_doors(10))) self.assertEqual(result, ["1", "4", "9"])
def test_collect_open_doors_10_every_left_closed(self): result = collect_open_doors(generate_doors(10)) self.assertEqual(result, [])