예제 #1
0
파일: tests.py 프로젝트: ibra86/common
    def test_get_roof_square(self):
        actual_res = self.house.get_roof_square()
        expected_res = 60
        assert actual_res == expected_res

        house_with_other_roof = House()
        house_with_other_roof.create_roof(10, 6, "gable")
        actual_res = house_with_other_roof.get_roof_square()
        expected_res = 120
        assert actual_res == expected_res
예제 #2
0
 def test_get_count_and_sum_of_windows(self):
     window = House()
     window.create_window(2, 1)
     self.assertEqual(1, window.get_count_of_windows())
     self.assertEqual(2, window.get_windows_square())
     with self.assertRaises(ValueError):
         window.create_window(0, 0)
예제 #3
0
파일: tests.py 프로젝트: ibra86/common
 def setup_class(cls):
     cls.house = House()
     cls.house.create_wall(10, 2.5)
     cls.house.create_wall(10, 2.5)
     cls.house.create_wall(14, 2.5)
     cls.house.create_wall(14, 2.5)
     cls.house.create_roof(10, 6, "single-pitch")
     cls.house.create_door(1, 2)
     cls.house.create_window(3, 1)
예제 #4
0
 def test_get_door_square(self):
     door = House()
     result = [4]
     door_h_w = [2]
     split = zip(door_h_w, result)
     for d, res in split:
         door.create_door(d, d)
         self.assertEqual(res, door.get_door_square())
     for d in split:
         result.append(5)
         door_h_w.append(5)
         with self.assertRaises(ValueError):
             door.create_door(d, d)
예제 #5
0
파일: tests.py 프로젝트: ibra86/common
 def test_zero_wall(self):
     with pytest.raises(ValueError):
         zero_house = House()
         zero_house.create_wall(0, 0)
예제 #6
0
 def test_number_of_rolls_of_wallpapers(self):
     wall = House()
     self.assertEqual(4.75, wall.get_number_of_rolls_of_wallpapers(2, 4))
예제 #7
0
 def test_roof_square(self):
     roof = House()
     roof.create_roof(2, 2, "gable")
     self.assertEqual(8, roof.get_roof_square())
예제 #8
0
 def test_update_metal_price(self):
     price = House()
     price.create_door(2, 2)
     price.update_metal_price(15)
     self.assertEqual(60, price.get_door_price("metal"))
예제 #9
0
 def test_update_wood_price(self):
     price = House()
     price.create_door(2, 2)
     price.update_wood_price(40)
     self.assertEqual(160, price.get_door_price("wood"))
예제 #10
0
 def test_get_door_price(self):
     price = House()
     price.create_door(2, 2)
     self.assertEqual(40, price.get_door_price("wood"))
예제 #11
0
 def test_get_count_and_sum_of_walls(self):
     wall = House()
     wall_meter = [wall.create_wall(2, 2), wall.create_wall(2, 3), wall.create_wall(5, 2), wall.create_wall(5, 5)]
     self.assertEqual(4, wall.get_count_of_walls())
     self.assertEqual(45, wall.get_walls_square())
예제 #12
0
 def setUp(self) -> None:
     self.house = [
         House(),
     ]