コード例 #1
0
 def test_wrongly_defined_to_group_method(self):
     example_turbine = {
         'hub_height': 100,
         'rotor_diameter': 70,
         'turbine_type': 'DUMMY 3',
         'path': self.source
     }
     e_t_1 = WindTurbine(**example_turbine)
     with pytest.raises(ValueError,
                        match="The 'number' and the 'total_capacity' "
                        "parameter are mutually exclusive."):
         e_t_1.to_group(5, 3000)
コード例 #2
0
 def test_to_group_method(self):
     example_turbine = {
         "hub_height": 100,
         "rotor_diameter": 70,
         "turbine_type": "DUMMY 3",
         "path": self.source,
     }
     e_t_1 = WindTurbine(**example_turbine)
     assert isinstance(e_t_1.to_group(), WindTurbineGroup)
     assert e_t_1.to_group(5).number_of_turbines == 5
     assert e_t_1.to_group(number_turbines=5).number_of_turbines == 5
     assert e_t_1.to_group(total_capacity=3e6).number_of_turbines == 2.0
コード例 #3
0
 def test_to_group_method(self):
     example_turbine = {
         'hub_height': 100,
         'rotor_diameter': 70,
         'turbine_type': 'DUMMY 3',
         'path': self.source
     }
     e_t_1 = WindTurbine(**example_turbine)
     assert (isinstance(e_t_1.to_group(), WindTurbineGroup))
     assert (e_t_1.to_group(5).number_of_turbines == 5)
     assert (e_t_1.to_group(number_turbines=5).number_of_turbines == 5)
     assert (e_t_1.to_group(total_capacity=3e6).number_of_turbines == 2.0)
コード例 #4
0
 def test_wrongly_defined_to_group_method(self):
     example_turbine = {
         "hub_height": 100,
         "rotor_diameter": 70,
         "turbine_type": "DUMMY 3",
         "path": self.source,
     }
     e_t_1 = WindTurbine(**example_turbine)
     with pytest.raises(
         ValueError,
         match="The 'number' and the 'total_capacity' "
         "parameter are mutually exclusive.",
     ):
         e_t_1.to_group(5, 3000)