From 995d22942a5fe5ad5442edd5aed8353887e51785 Mon Sep 17 00:00:00 2001 From: abhishekvraman Date: Sat, 11 Mar 2023 11:55:00 +0530 Subject: [PATCH 1/4] adding dimensionless property support --- src/propylean/properties.py | 42 ++++++++----- src/propylean/streams.py | 36 +++++------ src/propylean/validators.py | 2 +- tests/test_properties/test_properties.py | 76 ++++++++++++++++-------- 4 files changed, 97 insertions(+), 59 deletions(-) diff --git a/src/propylean/properties.py b/src/propylean/properties.py index cf889c4..dac820a 100644 --- a/src/propylean/properties.py +++ b/src/propylean/properties.py @@ -547,11 +547,33 @@ def __eq__(self, other): return True return False -class Efficiency(_Property): - def __init__(self, value=1, time_series=None, min_val=1, max_val=1): +class Dimensionless(_Property): + def __init__(self, value=None, name=None, time_series=None, min_val=None, max_val=None): super().__init__(value=value, unit=None, time_series=time_series, max_val=max_val, min_val=min_val) - if value <= 0 or min_val <= 0 or max_val <= 0: - raise Exception("Provide a positive value for efficiency.") + self._name = name + + @property + def name(self): + return self._name if self._name is not None else str(self.__class__.__name__) + @name.setter + def name(self, value): + self._name = value + + @property + def unit(self): + return None + @unit.setter + def unit(self, unit): + raise Exception("{} does not have unit.".format(self.name)) + + def __repr__(self) -> str: + return "{} with value {}".format(self.name, self.value) + +class Efficiency(Dimensionless): + def __init__(self, value=1, time_series=None, min_val=0, max_val=1): + super().__init__(value=value, name="Efficiency", time_series=time_series, max_val=max_val, min_val=min_val) + if value < 0 or min_val < 0 or max_val < 0: + raise Exception("Provide a non-negative value for efficiency.") else: if value > 1: self.value = value/100 @@ -561,14 +583,4 @@ def __init__(self, value=1, time_series=None, min_val=1, max_val=1): warn("Efficiency max_val set to {} considering value provided in percent.".format(max_val/100)) if min_val > 1: self.min_val = min_val/100 - warn("Efficiency min_val set to {} considering value provided in percent.".format(min_val/100)) - - def __repr__(self) -> str: - return str(self.value * 100) + "%" - - @property - def unit(self): - return None - @unit.setter - def unit(self, unit): - raise Exception("Efficiency is dimensionless.") \ No newline at end of file + warn("Efficiency min_val set to {} considering value provided in percent.".format(min_val/100)) \ No newline at end of file diff --git a/src/propylean/streams.py b/src/propylean/streams.py index 01da020..7f97984 100644 --- a/src/propylean/streams.py +++ b/src/propylean/streams.py @@ -1,6 +1,7 @@ from thermo import Mixture import propylean.properties as prop from propylean.validators import _Validators +from statistics import fmean class Stream(object): @@ -75,7 +76,7 @@ def _tuple_property_value_unit_returner(self, value, property_type): return value, None -class EnergyStream (Stream): +class EnergyStream(Stream): items = [] def __init__(self, tag=None, amount=(0, 'W')): super().__init__(tag) @@ -110,7 +111,7 @@ def list_objects(cls): def delete(self): """ DESCRIPTION: - Method to delete an MaterialStream object. + Method to delete an EnergyStream object. PARAMETERS: None @@ -395,7 +396,7 @@ def isentropic_exponent(self): return self._isentropic_exponent @isentropic_exponent.setter def isentropic_exponent(self, value): - _Validators.validate_arg_prop_value_type("isentropic_exponent", value, (int, float)) + _Validators.validate_arg_prop_value_type("isentropic_exponent", value, (int, float, prop.Dimensionless)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) @@ -447,7 +448,7 @@ def Z(self): return self._Z @Z.setter def Z(self, value): - _Validators.validate_arg_prop_value_type("Z", value, (int, float)) + _Validators.validate_arg_prop_value_type("Z", value, (int, float, prop.Dimensionless)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) @@ -460,7 +461,7 @@ def Z_g(self): return self._Z_g @Z_g.setter def Z_g(self, value): - _Validators.validate_arg_prop_value_type("Z_g", value, (int, float)) + _Validators.validate_arg_prop_value_type("Z_g", value, (int, float, prop.Dimensionless)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) @@ -473,7 +474,7 @@ def Z_l(self): return self._Z_l @Z_l.setter def Z_l(self, value): - _Validators.validate_arg_prop_value_type("Z_l", value, (int, float)) + _Validators.validate_arg_prop_value_type("Z_l", value, (int, float, prop.Dimensionless)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) @@ -498,7 +499,7 @@ def _update_properties(self): self.pressure.unit = old_p_unit self.temperature.unit = old_t_unit - # Assigning Phase + # Assigning Phase. phase = mx.phase if phase is not None: self.phase = phase @@ -537,34 +538,33 @@ def _update_properties(self): #Assiging Compressibility Factor Z Z = mx.Z if Z is not None: - self.Z = Z + self.Z = prop.Dimensionless(value=Z, name="Compressibility factor (Z)") Z_l = mx.Zl if Z_l is not None: - self.Z_l = Z_l + self.Z_l = prop.Dimensionless(value=Z_l, name="Compressibility factor of mixture in liquid phase (Z_l)") Z_g = mx.Zg if Z_g is not None: - self.Z_g = Z_g + self.Z_g = prop.Dimensionless(value=Z_g, name="Compressibility factor of mixture gaseous phase (Z_g)") - # Assigning Isnetropic Exponent + # Assigning Isnetropic Exponent. isentropic_exponent = mx.isentropic_exponent if isentropic_exponent is not None: - self.isentropic_exponent = isentropic_exponent + self.isentropic_exponent = prop.Dimensionless(value=isentropic_exponent, name="Isentropic Exponent") - # Assiging Psat and Pc + # Assigning Psat and Pc. Psat_indiv = mx.Psats Psat = None if len(Psat_indiv)==1: Psat = Psat_indiv[0] else: - import statistics - Psat = statistics.fmean(Psat_indiv) + Psat = fmean(Psat_indiv) if Psat is not None: - self.Psat = Psat + self.Psat = prop.Pressure(Psat, unit="Pa") Pc = mx.Pc if Pc is not None: - self.Pc = Pc + self.Pc = prop.Pressure(Pc, unit="Pa") @classmethod def list_objects(cls): @@ -572,7 +572,7 @@ def list_objects(cls): def __repr__(self) -> str: self = self._get_stream_object(self) - return 'Material Stream Tag: ' + self.tag + return 'Material Stream with tag: ' + self.tag def delete(self): """ diff --git a/src/propylean/validators.py b/src/propylean/validators.py index ced720f..027c73f 100644 --- a/src/propylean/validators.py +++ b/src/propylean/validators.py @@ -21,7 +21,7 @@ def validate_arg_prop_value_type(cls, arg_prop_name, value, correct_types): """ if value is not None and not isinstance(value, correct_types): raise Exception("""Incorrect type '{0}' provided to '{1}'. Should be '{2}'. - """.format(type(value), arg_prop_name, str(correct_types))) + """.format(value.__class__.__name__, arg_prop_name, correct_types.__class__.__name__)) return True @classmethod diff --git a/tests/test_properties/test_properties.py b/tests/test_properties/test_properties.py index b3627c5..61c4872 100644 --- a/tests/test_properties/test_properties.py +++ b/tests/test_properties/test_properties.py @@ -31,11 +31,11 @@ def test_Length_incorrect_instantiation(): def test_Length_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Length([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative @@ -76,11 +76,11 @@ def test_Time_incorrect_instantiation(): def test_Time_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Time([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.Time() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_Time_incorrect_type_to_unit(): @@ -119,11 +119,11 @@ def test_Pressure_incorrect_instantiation_conversion(): def test_Pressure_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Pressure([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.Pressure() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_Pressure_incorrect_type_to_unit(): @@ -169,11 +169,11 @@ def test_Temperature_incorrect_instantiation_conversion(): def test_Temperature_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Temperature([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.Temperature() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_Temperature_incorrect_type_to_unit(): @@ -216,11 +216,11 @@ def test_MassFlowRate_incorrect_instantiatio_conversion(): def test_MassFlowRate_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.MassFlowRate([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.MassFlowRate() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_MassFlowRate_incorrect_type_to_unit(): @@ -261,11 +261,11 @@ def test_MolarFlowRate_incorrect_instantiation_conversion(): def test_MolarFlowRate_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.MolarFlowRate([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.MolarFlowRate() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_MolarFlowRate_incorrect_type_to_unit(): @@ -305,11 +305,11 @@ def test_VolumeFlowRate_incorrect_instantiation_conversion(): def test_VolumetricFlowRate_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.VolumetricFlowRate([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.VolumetricFlowRate() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_VolumetricFlowRate_incorrect_type_to_unit(): @@ -358,11 +358,11 @@ def test_Power_instantiation_conversion(): def test_Power_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Power([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.Power() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_Power_incorrect_type_to_unit(): @@ -389,11 +389,11 @@ def test_property_density(): def test_Density_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Density([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.Density() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_Desnisty_incorrect_type_to_unit(): @@ -418,11 +418,11 @@ def test_property_dviscosity(): def test_DViscosity_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.DViscosity([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.DViscosity() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_DViscosity_incorrect_type_to_unit(): @@ -547,7 +547,7 @@ def test_time_series_incorrect_type_to_value(): with pytest.raises(Exception) as exp: l = properties.Length(10) l.time_series = [] - assert "Incorrect type '' provided to 'time_series'. Should be '(, , )" in str(exp) + assert "Incorrect type 'list' provided to 'time_series'. Should be '(, , )" in str(exp) @pytest.mark.positive def test_property_Efficiency(): @@ -560,16 +560,42 @@ def test_property_Efficiency(): def test_Efficiency_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Efficiency([10]) - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) with pytest.raises(Exception) as exp: l = properties.Efficiency() l.value = [] - assert "Incorrect type '' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) @pytest.mark.negative def test_Efficiency_setting_unit(): with pytest.raises(Exception) as exp: - l = properties.Efficiency() + l = properties.Efficiency(0.75) + l.unit = 10 + assert "Efficiency does not have unit." in str(exp) + +@pytest.mark.positive +def test_property_Dimensionless(): + re1 = properties.Dimensionless(value=70, min_val=60, max_val=80, name="Renolds Number") + assert re1.value == 70 + assert re1.min_val == 60 + assert re1.max_val == 80 + assert re1.name == "Renolds Number" + + +@pytest.mark.negative +def test_Dimensionless_incorrect_type_to_value(): + with pytest.raises(Exception) as exp: + properties.Dimensionless([10]) + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + with pytest.raises(Exception) as exp: + l = properties.Dimensionless() + l.value = [] + assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + +@pytest.mark.negative +def test_Dimensionless_setting_unit(): + with pytest.raises(Exception) as exp: + l = properties.Dimensionless(name="Reynolds Number") l.unit = 10 - assert "Efficiency is dimensionless." in str(exp) + assert "Reynolds Number does not have unit." in str(exp) \ No newline at end of file From 3f8c2312b446ecc24553417e5b58e5bf4292bcc5 Mon Sep 17 00:00:00 2001 From: abhishekvraman Date: Sat, 11 Mar 2023 12:28:13 +0530 Subject: [PATCH 2/4] minor correction. --- src/propylean/validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/propylean/validators.py b/src/propylean/validators.py index 027c73f..9906df3 100644 --- a/src/propylean/validators.py +++ b/src/propylean/validators.py @@ -20,8 +20,8 @@ def validate_arg_prop_value_type(cls, arg_prop_name, value, correct_types): Description: Correct types of the argument or property. """ if value is not None and not isinstance(value, correct_types): - raise Exception("""Incorrect type '{0}' provided to '{1}'. Should be '{2}'. - """.format(value.__class__.__name__, arg_prop_name, correct_types.__class__.__name__)) + raise Exception("Incorrect type '{0}' provided to '{1}'. Should be {2}."\ + .format(value.__class__.__name__, arg_prop_name, tuple(c_type.__name__ for c_type in correct_types))) return True @classmethod From 1b6e8ef8b01145f44d136d21f42ea0f6a53a9280 Mon Sep 17 00:00:00 2001 From: abhishekvraman Date: Sat, 11 Mar 2023 13:41:54 +0530 Subject: [PATCH 3/4] major changes --- src/propylean/instruments/control.py | 2 +- src/propylean/streams.py | 8 +- src/propylean/validators.py | 9 +- tests/test_equipments/test_AirCooler.py | 34 +++---- tests/test_equipments/test_Bullet.py | 64 ++++++------- .../test_CentrifugalCompressor.py | 30 +++---- tests/test_equipments/test_CentrifugalPump.py | 34 +++---- tests/test_equipments/test_ElectricHeater.py | 34 +++---- tests/test_equipments/test_PipeSegment.py | 46 +++++----- .../test_PositiveDisplacementPump.py | 34 +++---- tests/test_equipments/test_Sphere.py | 66 +++++++------- tests/test_equipments/test_Tank.py | 58 ++++++------ tests/test_equipments/test_TurboExpander.py | 30 +++---- tests/test_equipments/test_VerticalStorage.py | 66 +++++++------- .../test__HorizontalVessels.py | 66 +++++++------- .../test_equipments/test__SphericalVessels.py | 66 +++++++------- .../test_equipments/test__VerticalVessels.py | 66 +++++++------- tests/test_instruments/test_ControlValve.py | 34 +++---- tests/test_instruments/test_FlowMeter.py | 34 +++---- tests/test_properties/test_properties.py | 90 +++++++++---------- tests/test_streams/test_EnergyStream.py | 4 +- tests/test_streams/test_MaterialStream.py | 52 +++++------ 22 files changed, 466 insertions(+), 461 deletions(-) diff --git a/src/propylean/instruments/control.py b/src/propylean/instruments/control.py index 447365a..7d8bfdf 100644 --- a/src/propylean/instruments/control.py +++ b/src/propylean/instruments/control.py @@ -59,7 +59,7 @@ def Cv(self): Psat = self._connected_stream_property_getter(is_inlet, "material", "Psat") Pc = self._connected_stream_property_getter(is_inlet, "material", "Pc") if phase == 'l': - return cv_calculations.size_control_valve_l(density.value, Psat, Pc, d_viscosity.value, + return cv_calculations.size_control_valve_l(density.value, Psat.value, Pc.value, d_viscosity.value, P1.value, P2.value, self.inlet_mass_flowrate.value/density.value) elif phase == 'g' or phase == 'l/g': diff --git a/src/propylean/streams.py b/src/propylean/streams.py index 7f97984..3e41d60 100644 --- a/src/propylean/streams.py +++ b/src/propylean/streams.py @@ -396,7 +396,7 @@ def isentropic_exponent(self): return self._isentropic_exponent @isentropic_exponent.setter def isentropic_exponent(self, value): - _Validators.validate_arg_prop_value_type("isentropic_exponent", value, (int, float, prop.Dimensionless)) + _Validators.validate_arg_prop_value_type("isentropic_exponent", value, ( prop.Dimensionless, int, float)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) @@ -448,7 +448,7 @@ def Z(self): return self._Z @Z.setter def Z(self, value): - _Validators.validate_arg_prop_value_type("Z", value, (int, float, prop.Dimensionless)) + _Validators.validate_arg_prop_value_type("Z", value, (prop.Dimensionless, int, float)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) @@ -461,7 +461,7 @@ def Z_g(self): return self._Z_g @Z_g.setter def Z_g(self, value): - _Validators.validate_arg_prop_value_type("Z_g", value, (int, float, prop.Dimensionless)) + _Validators.validate_arg_prop_value_type("Z_g", value, (prop.Dimensionless, int, float)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) @@ -474,7 +474,7 @@ def Z_l(self): return self._Z_l @Z_l.setter def Z_l(self, value): - _Validators.validate_arg_prop_value_type("Z_l", value, (int, float, prop.Dimensionless)) + _Validators.validate_arg_prop_value_type("Z_l", value, (prop.Dimensionless, int, float)) if MaterialStream.property_package: raise Exception("Property cannot be changed when using a Property Package.") self = self._get_stream_object(self) diff --git a/src/propylean/validators.py b/src/propylean/validators.py index 9906df3..583d2e7 100644 --- a/src/propylean/validators.py +++ b/src/propylean/validators.py @@ -20,8 +20,13 @@ def validate_arg_prop_value_type(cls, arg_prop_name, value, correct_types): Description: Correct types of the argument or property. """ if value is not None and not isinstance(value, correct_types): - raise Exception("Incorrect type '{0}' provided to '{1}'. Should be {2}."\ - .format(value.__class__.__name__, arg_prop_name, tuple(c_type.__name__ for c_type in correct_types))) + if isinstance(correct_types, tuple): + correct_types = tuple(c_type.__name__ for c_type in correct_types) + else: + correct_types = correct_types.__name__ + + raise Exception("Incorrect type '{0}' provided to '{1}'. Should be '{2}'."\ + .format(value.__class__.__name__, arg_prop_name, correct_types)) return True @classmethod diff --git a/tests/test_equipments/test_AirCooler.py b/tests/test_equipments/test_AirCooler.py index e0745de..fd4393d 100644 --- a/tests/test_equipments/test_AirCooler.py +++ b/tests/test_equipments/test_AirCooler.py @@ -305,7 +305,7 @@ def test_AirCooler_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -313,7 +313,7 @@ def test_AirCooler_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -321,7 +321,7 @@ def test_AirCooler_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -329,7 +329,7 @@ def test_AirCooler_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -337,7 +337,7 @@ def test_AirCooler_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -345,7 +345,7 @@ def test_AirCooler_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -353,7 +353,7 @@ def test_AirCooler_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -361,7 +361,7 @@ def test_AirCooler_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -369,7 +369,7 @@ def test_AirCooler_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -377,7 +377,7 @@ def test_AirCooler_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -385,7 +385,7 @@ def test_AirCooler_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -393,7 +393,7 @@ def test_AirCooler_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -401,7 +401,7 @@ def test_AirCooler_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = AirCooler() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -412,22 +412,22 @@ def test_AirCooler_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_Bullet.py b/tests/test_equipments/test_Bullet.py index e7fc7c8..3a258fc 100644 --- a/tests/test_equipments/test_Bullet.py +++ b/tests/test_equipments/test_Bullet.py @@ -23,7 +23,7 @@ def test_Bullet_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -31,7 +31,7 @@ def test_Bullet_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -39,7 +39,7 @@ def test_Bullet_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -47,7 +47,7 @@ def test_Bullet_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -55,7 +55,7 @@ def test_Bullet_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -63,7 +63,7 @@ def test_Bullet_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -71,7 +71,7 @@ def test_Bullet_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -79,7 +79,7 @@ def test_Bullet_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -87,7 +87,7 @@ def test_Bullet_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -95,7 +95,7 @@ def test_Bullet_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -103,7 +103,7 @@ def test_Bullet_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -111,7 +111,7 @@ def test_Bullet_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -119,7 +119,7 @@ def test_Bullet_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -128,12 +128,12 @@ def test_Bullet_ID_incorrect_type_to_value(self): bullet = Bullet( ID=[4, "m"], length=(10, "m"), head_type="flat") - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = Bullet() m4.ID = [] - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -142,12 +142,12 @@ def test_Bullet_length_incorrect_type_to_value(self): bullet = Bullet( ID=(4, "m"), length=[10, "m"], head_type="flat") - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = Bullet() m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -156,12 +156,12 @@ def test_Bullet_heayd_type_incorrect_type_to_value(self): bullet = Bullet( ID=(4, "m"), length=(10, "m"), head_type=["flat"]) - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) with pytest.raises(Exception) as exp: m4 = Bullet() m4.head_type = [] - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) @pytest.mark.negative @@ -169,7 +169,7 @@ def test_Bullet_LLLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.LLLL = [] - self.assertIn("Incorrect type '' provided to 'LLLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -177,7 +177,7 @@ def test_Bullet_LLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.LLL = [] - self.assertIn("Incorrect type '' provided to 'LLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -185,7 +185,7 @@ def test_Bullet_NLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.NLL = [] - self.assertIn("Incorrect type '' provided to 'NLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'NLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -193,7 +193,7 @@ def test_Bullet_HLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.HLL = [] - self.assertIn("Incorrect type '' provided to 'HLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -201,7 +201,7 @@ def test_Bullet_HHLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.HHLL = [] - self.assertIn("Incorrect type '' provided to 'HHLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HHLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -209,7 +209,7 @@ def test_Bullet_operating_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.operating_temperature = [] - self.assertIn("Incorrect type '' provided to 'operating_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -217,7 +217,7 @@ def test_Bullet_operating_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Bullet() m4.operating_pressure = [] - self.assertIn("Incorrect type '' provided to 'operating_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -226,12 +226,12 @@ def test_Bullet_heayd_type_incorrect_value(self): Vertical_vessel = Bullet( ID=(4, "m"), length=(10, "m"), head_type="flatop") - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) with pytest.raises(Exception) as exp: m4 = Bullet() m4.head_type = "flatop" - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) @pytest.mark.negative @@ -243,22 +243,22 @@ def test_Bullet_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_CentrifugalCompressor.py b/tests/test_equipments/test_CentrifugalCompressor.py index 37c6b78..d941b56 100644 --- a/tests/test_equipments/test_CentrifugalCompressor.py +++ b/tests/test_equipments/test_CentrifugalCompressor.py @@ -360,7 +360,7 @@ def test_CentrifugalCompressor_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -368,7 +368,7 @@ def test_CentrifugalCompressor_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -376,7 +376,7 @@ def test_CentrifugalCompressor_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -384,7 +384,7 @@ def test_CentrifugalCompressor_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -392,7 +392,7 @@ def test_CentrifugalCompressor_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -400,7 +400,7 @@ def test_CentrifugalCompressor_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @@ -409,7 +409,7 @@ def test_CentrifugalCompressor_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -417,7 +417,7 @@ def test_CentrifugalCompressor_inlet_mass_flowrate_incorrect_type_to_value(self) with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -425,7 +425,7 @@ def test_CentrifugalCompressor_outlet_mass_flowrate_incorrect_type_to_value(self with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -433,7 +433,7 @@ def test_CentrifugalCompressor_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -441,7 +441,7 @@ def test_CentrifugalCompressor_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalCompressor() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -459,22 +459,22 @@ def test_CentrifugalCompressor_stream_connecion_disconnection_incorrect_type(sel with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_CentrifugalPump.py b/tests/test_equipments/test_CentrifugalPump.py index 570a639..2ff9a57 100644 --- a/tests/test_equipments/test_CentrifugalPump.py +++ b/tests/test_equipments/test_CentrifugalPump.py @@ -353,7 +353,7 @@ def test_CentrifugalPump_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -361,7 +361,7 @@ def test_CentrifugalPump_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -369,7 +369,7 @@ def test_CentrifugalPump_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -377,7 +377,7 @@ def test_CentrifugalPump_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -385,7 +385,7 @@ def test_CentrifugalPump_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -393,7 +393,7 @@ def test_CentrifugalPump_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -401,7 +401,7 @@ def test_CentrifugalPump_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -409,7 +409,7 @@ def test_CentrifugalPump_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -417,7 +417,7 @@ def test_CentrifugalPump_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -425,7 +425,7 @@ def test_CentrifugalPump_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -433,7 +433,7 @@ def test_CentrifugalPump_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -441,7 +441,7 @@ def test_CentrifugalPump_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -449,7 +449,7 @@ def test_CentrifugalPump_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = CentrifugalPump() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -461,22 +461,22 @@ def test_CentrifugalPump_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_ElectricHeater.py b/tests/test_equipments/test_ElectricHeater.py index 71fe0bc..3b85f9b 100644 --- a/tests/test_equipments/test_ElectricHeater.py +++ b/tests/test_equipments/test_ElectricHeater.py @@ -305,7 +305,7 @@ def test_ElectricHeater_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -313,7 +313,7 @@ def test_ElectricHeater_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -321,7 +321,7 @@ def test_ElectricHeater_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -329,7 +329,7 @@ def test_ElectricHeater_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -337,7 +337,7 @@ def test_ElectricHeater_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -345,7 +345,7 @@ def test_ElectricHeater_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -353,7 +353,7 @@ def test_ElectricHeater_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -361,7 +361,7 @@ def test_ElectricHeater_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -369,7 +369,7 @@ def test_ElectricHeater_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -377,7 +377,7 @@ def test_ElectricHeater_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -385,7 +385,7 @@ def test_ElectricHeater_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -393,7 +393,7 @@ def test_ElectricHeater_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -401,7 +401,7 @@ def test_ElectricHeater_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ElectricHeater() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -413,22 +413,22 @@ def test_ElectricHeater_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_PipeSegment.py b/tests/test_equipments/test_PipeSegment.py index 0dde591..7d8045a 100644 --- a/tests/test_equipments/test_PipeSegment.py +++ b/tests/test_equipments/test_PipeSegment.py @@ -390,7 +390,7 @@ def test_PipeSegment_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -398,7 +398,7 @@ def test_PipeSegment_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @@ -407,7 +407,7 @@ def test_PipeSegment_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -415,7 +415,7 @@ def test_PipeSegment_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -423,7 +423,7 @@ def test_PipeSegment_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -431,7 +431,7 @@ def test_PipeSegment_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -439,7 +439,7 @@ def test_PipeSegment_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -447,7 +447,7 @@ def test_PipeSegment_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -455,7 +455,7 @@ def test_PipeSegment_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -463,7 +463,7 @@ def test_PipeSegment_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -471,7 +471,7 @@ def test_PipeSegment_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -479,7 +479,7 @@ def test_PipeSegment_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -487,7 +487,7 @@ def test_PipeSegment_length_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -495,7 +495,7 @@ def test_PipeSegment_ID_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=[18, 'mm'], shape=(20, 18)) - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -503,7 +503,7 @@ def test_PipeSegment_OD_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.OD = [] - self.assertIn("Incorrect type '' provided to 'OD'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'OD'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -511,7 +511,7 @@ def test_PipeSegment_elevation_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=13, ID=(18, 'mm'), shape=(20, 18)) m4.elevation = [] - self.assertIn("Incorrect type '' provided to 'elevation'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'elevation'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -519,12 +519,12 @@ def test_PipeSegment_segmen_type_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(segment_type=[13], ID=(18, 'mm'), shape=(20, 18)) - self.assertIn("Incorrect type '' provided to 'segment_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'segment_type'. Should be 'int'", str(exp)) with pytest.raises(Exception) as exp: m4 = PipeSegment(length=(10, "m"), ID=(18, 'mm'), shape=(20, 18)) m4.segment_type = [] - self.assertIn("Incorrect type '' provided to 'segment_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'segment_type'. Should be 'int'", str(exp)) @pytest.mark.negative @@ -533,7 +533,7 @@ def test_PipeSegment_material_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PipeSegment(length=(10, "m"), ID=(18, 'mm'), shape=(20, 18)) m4.material = [] - self.assertIn("Incorrect type '' provided to 'material'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'material'. Should be 'int'", str(exp)) @pytest.mark.negative @@ -545,22 +545,22 @@ def test_PipeSegment_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_PositiveDisplacementPump.py b/tests/test_equipments/test_PositiveDisplacementPump.py index 2bd4605..d6af258 100644 --- a/tests/test_equipments/test_PositiveDisplacementPump.py +++ b/tests/test_equipments/test_PositiveDisplacementPump.py @@ -328,7 +328,7 @@ def test_PositiveDisplacementPump_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -336,7 +336,7 @@ def test_PositiveDisplacementPump_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -344,7 +344,7 @@ def test_PositiveDisplacementPump_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -352,7 +352,7 @@ def test_PositiveDisplacementPump_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -360,7 +360,7 @@ def test_PositiveDisplacementPump_inlet_temperature_incorrect_type_to_value(self with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -368,7 +368,7 @@ def test_PositiveDisplacementPump_outlet_temperature_incorrect_type_to_value(sel with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -376,7 +376,7 @@ def test_PositiveDisplacementPump_temperature_decrease_incorrect_type_to_value(s with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -384,7 +384,7 @@ def test_PositiveDisplacementPump_temperature_increase_incorrect_type_to_value(s with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -392,7 +392,7 @@ def test_PositiveDisplacementPump_design_temperature_incorrect_type_to_value(sel with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -400,7 +400,7 @@ def test_PositiveDisplacementPump_inlet_mass_flowrate_incorrect_type_to_value(se with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -408,7 +408,7 @@ def test_PositiveDisplacementPump_outlet_mass_flowrate_incorrect_type_to_value(s with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -416,7 +416,7 @@ def test_PositiveDisplacementPump_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -424,7 +424,7 @@ def test_PositiveDisplacementPump_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = PositiveDisplacementPump() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -436,22 +436,22 @@ def test_PositiveDisplacementPump_stream_connecion_disconnection_incorrect_type( with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_Sphere.py b/tests/test_equipments/test_Sphere.py index f4a6eb6..e2d6b00 100644 --- a/tests/test_equipments/test_Sphere.py +++ b/tests/test_equipments/test_Sphere.py @@ -23,7 +23,7 @@ def test_Sphere_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -31,7 +31,7 @@ def test_Sphere_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -39,7 +39,7 @@ def test_Sphere_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -47,7 +47,7 @@ def test_Sphere_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -55,7 +55,7 @@ def test_Sphere_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -63,7 +63,7 @@ def test_Sphere_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -71,7 +71,7 @@ def test_Sphere_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -79,7 +79,7 @@ def test_Sphere_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -87,7 +87,7 @@ def test_Sphere_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -95,7 +95,7 @@ def test_Sphere_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -103,7 +103,7 @@ def test_Sphere_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -111,7 +111,7 @@ def test_Sphere_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -119,7 +119,7 @@ def test_Sphere_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -128,12 +128,12 @@ def test_Sphere_ID_incorrect_type_to_value(self): horizontal_vessel = Sphere( ID=[4, "m"], length=(10, "m"), head_type="flat") - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = Sphere() m4.ID = [] - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -142,12 +142,12 @@ def test_Sphere_length_incorrect_type_to_value(self): horizontal_vessel = Sphere( ID=(4, "m"), length=[10, "m"], head_type="flat") - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = Sphere() m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -156,12 +156,12 @@ def test_Sphere_heayd_type_incorrect_type_to_value(self): horizontal_vessel = Sphere( ID=(4, "m"), length=(10, "m"), head_type=["flat"]) - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) with pytest.raises(Exception) as exp: m4 = Sphere() m4.head_type = [] - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) @pytest.mark.negative @@ -169,7 +169,7 @@ def test_Sphere_LLLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.LLLL = [] - self.assertIn("Incorrect type '' provided to 'LLLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -177,7 +177,7 @@ def test_Sphere_LLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.LLL = [] - self.assertIn("Incorrect type '' provided to 'LLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -185,7 +185,7 @@ def test_Sphere_NLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.NLL = [] - self.assertIn("Incorrect type '' provided to 'NLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'NLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -193,7 +193,7 @@ def test_Sphere_HLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.HLL = [] - self.assertIn("Incorrect type '' provided to 'HLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -201,7 +201,7 @@ def test_Sphere_HHLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.HHLL = [] - self.assertIn("Incorrect type '' provided to 'HHLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HHLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -209,7 +209,7 @@ def test_Sphere_operating_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.operating_temperature = [] - self.assertIn("Incorrect type '' provided to 'operating_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -217,7 +217,7 @@ def test_Sphere_operating_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.operating_pressure = [] - self.assertIn("Incorrect type '' provided to 'operating_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -226,12 +226,12 @@ def test_Sphere_heayd_type_incorrect_value(self): Vertical_vessel = Sphere( ID=(4, "m"), length=(10, "m"), head_type="flatop") - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) with pytest.raises(Exception) as exp: m4 = Sphere() m4.head_type = "flatop" - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) @pytest.mark.negative @@ -243,22 +243,22 @@ def test_Sphere_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative @@ -280,7 +280,7 @@ def test_Sphere_get_inventory_incorrect_type_to_type(self): with pytest.raises(Exception) as exp: m4 = Sphere() m4.get_inventory([]) - self.assertIn("Incorrect type '' provided to 'type'. Should be '", + self.assertIn("Incorrect type 'list' provided to 'type'. Should be 'str", str(exp)) @pytest.mark.negative @pytest.mark.get_inventory diff --git a/tests/test_equipments/test_Tank.py b/tests/test_equipments/test_Tank.py index 0946675..1f7f20e 100644 --- a/tests/test_equipments/test_Tank.py +++ b/tests/test_equipments/test_Tank.py @@ -23,7 +23,7 @@ def test_Tank_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -31,7 +31,7 @@ def test_Tank_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -39,7 +39,7 @@ def test_Tank_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -47,7 +47,7 @@ def test_Tank_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -55,7 +55,7 @@ def test_Tank_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -63,7 +63,7 @@ def test_Tank_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -71,7 +71,7 @@ def test_Tank_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -79,7 +79,7 @@ def test_Tank_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -87,7 +87,7 @@ def test_Tank_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -95,7 +95,7 @@ def test_Tank_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -103,7 +103,7 @@ def test_Tank_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -111,7 +111,7 @@ def test_Tank_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -119,31 +119,31 @@ def test_Tank_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_Tank_ID_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: horizontal_vessel = Tank(ID=[4, "m"], length=(10, "m")) - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = Tank() m4.ID = [] - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_Tank_length_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: horizontal_vessel = Tank(ID=(4, "m"), length=[10, "m"]) - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = Tank() m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @@ -153,7 +153,7 @@ def test_Tank_LLLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.LLLL = [] - self.assertIn("Incorrect type '' provided to 'LLLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -161,7 +161,7 @@ def test_Tank_LLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.LLL = [] - self.assertIn("Incorrect type '' provided to 'LLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -169,7 +169,7 @@ def test_Tank_NLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.NLL = [] - self.assertIn("Incorrect type '' provided to 'NLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'NLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -177,7 +177,7 @@ def test_Tank_HLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.HLL = [] - self.assertIn("Incorrect type '' provided to 'HLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -185,7 +185,7 @@ def test_Tank_HHLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.HHLL = [] - self.assertIn("Incorrect type '' provided to 'HHLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HHLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -193,7 +193,7 @@ def test_Tank_operating_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.operating_temperature = [] - self.assertIn("Incorrect type '' provided to 'operating_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -201,7 +201,7 @@ def test_Tank_operating_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.operating_pressure = [] - self.assertIn("Incorrect type '' provided to 'operating_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -213,22 +213,22 @@ def test_Tank_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative @@ -250,7 +250,7 @@ def test_Tank_get_inventory_incorrect_type_to_type(self): with pytest.raises(Exception) as exp: m4 = Tank() m4.get_inventory([]) - self.assertIn("Incorrect type '' provided to 'type'. Should be '", + self.assertIn("Incorrect type 'list' provided to 'type'. Should be 'str", str(exp)) @pytest.mark.negative @pytest.mark.get_inventory diff --git a/tests/test_equipments/test_TurboExpander.py b/tests/test_equipments/test_TurboExpander.py index bdbf70a..d966a85 100644 --- a/tests/test_equipments/test_TurboExpander.py +++ b/tests/test_equipments/test_TurboExpander.py @@ -359,7 +359,7 @@ def test_TurboExpander_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -367,7 +367,7 @@ def test_TurboExpander_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -375,7 +375,7 @@ def test_TurboExpander_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -383,7 +383,7 @@ def test_TurboExpander_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -391,7 +391,7 @@ def test_TurboExpander_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -399,7 +399,7 @@ def test_TurboExpander_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -407,7 +407,7 @@ def test_TurboExpander_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -415,7 +415,7 @@ def test_TurboExpander_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -423,7 +423,7 @@ def test_TurboExpander_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -431,7 +431,7 @@ def test_TurboExpander_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -439,7 +439,7 @@ def test_TurboExpander_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = TurboExpander() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -457,22 +457,22 @@ def test_TurboExpander_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test_VerticalStorage.py b/tests/test_equipments/test_VerticalStorage.py index 88753bf..7a8260b 100644 --- a/tests/test_equipments/test_VerticalStorage.py +++ b/tests/test_equipments/test_VerticalStorage.py @@ -23,7 +23,7 @@ def test_VerticalStorage_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -31,7 +31,7 @@ def test_VerticalStorage_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -39,7 +39,7 @@ def test_VerticalStorage_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -47,7 +47,7 @@ def test_VerticalStorage_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -55,7 +55,7 @@ def test_VerticalStorage_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -63,7 +63,7 @@ def test_VerticalStorage_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -71,7 +71,7 @@ def test_VerticalStorage_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -79,7 +79,7 @@ def test_VerticalStorage_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -87,7 +87,7 @@ def test_VerticalStorage_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -95,7 +95,7 @@ def test_VerticalStorage_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -103,7 +103,7 @@ def test_VerticalStorage_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -111,7 +111,7 @@ def test_VerticalStorage_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -119,7 +119,7 @@ def test_VerticalStorage_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -128,12 +128,12 @@ def test_VerticalStorage_ID_incorrect_type_to_value(self): horizontal_vessel = VerticalStorage( ID=[4, "m"], length=(10, "m"), head_type="flat") - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.ID = [] - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -142,12 +142,12 @@ def test_VerticalStorage_length_incorrect_type_to_value(self): horizontal_vessel = VerticalStorage( ID=(4, "m"), length=[10, "m"], head_type="flat") - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -156,12 +156,12 @@ def test_VerticalStorage_heayd_type_incorrect_type_to_value(self): horizontal_vessel = VerticalStorage( ID=(4, "m"), length=(10, "m"), head_type=["flat"]) - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.head_type = [] - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) @pytest.mark.negative @@ -169,7 +169,7 @@ def test_VerticalStorage_LLLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.LLLL = [] - self.assertIn("Incorrect type '' provided to 'LLLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -177,7 +177,7 @@ def test_VerticalStorage_LLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.LLL = [] - self.assertIn("Incorrect type '' provided to 'LLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -185,7 +185,7 @@ def test_VerticalStorage_NLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.NLL = [] - self.assertIn("Incorrect type '' provided to 'NLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'NLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -193,7 +193,7 @@ def test_VerticalStorage_HLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.HLL = [] - self.assertIn("Incorrect type '' provided to 'HLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -201,7 +201,7 @@ def test_VerticalStorage_HHLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.HHLL = [] - self.assertIn("Incorrect type '' provided to 'HHLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HHLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -209,7 +209,7 @@ def test_VerticalStorage_operating_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.operating_temperature = [] - self.assertIn("Incorrect type '' provided to 'operating_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -217,7 +217,7 @@ def test_VerticalStorage_operating_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.operating_pressure = [] - self.assertIn("Incorrect type '' provided to 'operating_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -226,12 +226,12 @@ def test_VerticalStorage_heayd_type_incorrect_value(self): Vertical_vessel = VerticalStorage( ID=(4, "m"), length=(10, "m"), head_type="flatop") - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.head_type = "flatop" - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) @pytest.mark.negative @@ -243,22 +243,22 @@ def test_VerticalStorage_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative @@ -280,7 +280,7 @@ def test_VerticalStorage_get_inventory_incorrect_type_to_type(self): with pytest.raises(Exception) as exp: m4 = VerticalStorage() m4.get_inventory([]) - self.assertIn("Incorrect type '' provided to 'type'. Should be '", + self.assertIn("Incorrect type 'list' provided to 'type'. Should be 'str", str(exp)) @pytest.mark.negative @pytest.mark.get_inventory diff --git a/tests/test_equipments/test__HorizontalVessels.py b/tests/test_equipments/test__HorizontalVessels.py index 4d28cdb..0d1e2df 100644 --- a/tests/test_equipments/test__HorizontalVessels.py +++ b/tests/test_equipments/test__HorizontalVessels.py @@ -431,7 +431,7 @@ def test__HorizontalVessels_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -439,7 +439,7 @@ def test__HorizontalVessels_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -447,7 +447,7 @@ def test__HorizontalVessels_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -455,7 +455,7 @@ def test__HorizontalVessels_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -463,7 +463,7 @@ def test__HorizontalVessels_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -471,7 +471,7 @@ def test__HorizontalVessels_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -479,7 +479,7 @@ def test__HorizontalVessels_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -487,7 +487,7 @@ def test__HorizontalVessels_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -495,7 +495,7 @@ def test__HorizontalVessels_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -503,7 +503,7 @@ def test__HorizontalVessels_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -511,7 +511,7 @@ def test__HorizontalVessels_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -519,7 +519,7 @@ def test__HorizontalVessels_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -527,7 +527,7 @@ def test__HorizontalVessels_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -536,12 +536,12 @@ def test__HorizontalVessels_ID_incorrect_type_to_value(self): horizontal_vessel = _HorizontalVessels( ID=[4, "m"], length=(10, "m"), head_type="flat") - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.ID = [] - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -550,12 +550,12 @@ def test__HorizontalVessels_length_incorrect_type_to_value(self): horizontal_vessel = _HorizontalVessels( ID=(4, "m"), length=[10, "m"], head_type="flat") - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -564,12 +564,12 @@ def test__HorizontalVessels_heayd_type_incorrect_type_to_value(self): horizontal_vessel = _HorizontalVessels( ID=(4, "m"), length=(10, "m"), head_type=["flat"]) - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.head_type = [] - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) @pytest.mark.negative def test__HorizontalVessels_heayd_type_incorrect_value(self): @@ -577,12 +577,12 @@ def test__HorizontalVessels_heayd_type_incorrect_value(self): horizontal_vessel = _HorizontalVessels( ID=(4, "m"), length=(10, "m"), head_type="flatop") - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.head_type = "flatop" - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) @pytest.mark.negative @@ -590,7 +590,7 @@ def test__HorizontalVessels_LLLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.LLLL = [] - self.assertIn("Incorrect type '' provided to 'LLLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -598,7 +598,7 @@ def test__HorizontalVessels_LLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.LLL = [] - self.assertIn("Incorrect type '' provided to 'LLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -606,7 +606,7 @@ def test__HorizontalVessels_NLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.NLL = [] - self.assertIn("Incorrect type '' provided to 'NLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'NLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -614,7 +614,7 @@ def test__HorizontalVessels_HLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.HLL = [] - self.assertIn("Incorrect type '' provided to 'HLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -622,7 +622,7 @@ def test__HorizontalVessels_HHLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.HHLL = [] - self.assertIn("Incorrect type '' provided to 'HHLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HHLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -630,7 +630,7 @@ def test__HorizontalVessels_operating_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.operating_temperature = [] - self.assertIn("Incorrect type '' provided to 'operating_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -638,7 +638,7 @@ def test__HorizontalVessels_operating_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.operating_pressure = [] - self.assertIn("Incorrect type '' provided to 'operating_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -647,7 +647,7 @@ def test__HorizontalVessels_get_inventory_incorrect_type_to_type(self): with pytest.raises(Exception) as exp: m4 = _HorizontalVessels() m4.get_inventory([]) - self.assertIn("Incorrect type '' provided to 'type'. Should be '", + self.assertIn("Incorrect type 'list' provided to 'type'. Should be 'str", str(exp)) @pytest.mark.negative @pytest.mark.get_inventory @@ -666,22 +666,22 @@ def test__HorizontalVessels_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_equipments/test__SphericalVessels.py b/tests/test_equipments/test__SphericalVessels.py index bc12600..ad60ba0 100644 --- a/tests/test_equipments/test__SphericalVessels.py +++ b/tests/test_equipments/test__SphericalVessels.py @@ -312,7 +312,7 @@ def test__SphericalVessels_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -320,7 +320,7 @@ def test__SphericalVessels_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -328,7 +328,7 @@ def test__SphericalVessels_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -336,7 +336,7 @@ def test__SphericalVessels_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -344,7 +344,7 @@ def test__SphericalVessels_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -352,7 +352,7 @@ def test__SphericalVessels_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -360,7 +360,7 @@ def test__SphericalVessels_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -368,7 +368,7 @@ def test__SphericalVessels_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -376,7 +376,7 @@ def test__SphericalVessels_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -384,7 +384,7 @@ def test__SphericalVessels_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -392,7 +392,7 @@ def test__SphericalVessels_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -400,7 +400,7 @@ def test__SphericalVessels_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -408,7 +408,7 @@ def test__SphericalVessels_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -417,12 +417,12 @@ def test__SphericalVessels_ID_incorrect_type_to_value(self): Spherical_vessel = _SphericalVessels( ID=[4, "m"], length=(10, "m"), head_type="flat") - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.ID = [] - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -431,12 +431,12 @@ def test__SphericalVessels_length_incorrect_type_to_value(self): Spherical_vessel = _SphericalVessels( ID=(4, "m"), length=[10, "m"], head_type="flat") - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -445,12 +445,12 @@ def test__SphericalVessels_heayd_type_incorrect_type_to_value(self): Spherical_vessel = _SphericalVessels( ID=(4, "m"), length=(10, "m"), head_type=["flat"]) - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.head_type = [] - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) @pytest.mark.negative @@ -458,7 +458,7 @@ def test__SphericalVessels_LLLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.LLLL = [] - self.assertIn("Incorrect type '' provided to 'LLLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -466,7 +466,7 @@ def test__SphericalVessels_LLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.LLL = [] - self.assertIn("Incorrect type '' provided to 'LLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -474,7 +474,7 @@ def test__SphericalVessels_NLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.NLL = [] - self.assertIn("Incorrect type '' provided to 'NLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'NLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -482,7 +482,7 @@ def test__SphericalVessels_HLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.HLL = [] - self.assertIn("Incorrect type '' provided to 'HLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -490,7 +490,7 @@ def test__SphericalVessels_HHLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.HHLL = [] - self.assertIn("Incorrect type '' provided to 'HHLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HHLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -498,7 +498,7 @@ def test__SphericalVessels_operating_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.operating_temperature = [] - self.assertIn("Incorrect type '' provided to 'operating_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -506,7 +506,7 @@ def test__SphericalVessels_operating_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.operating_pressure = [] - self.assertIn("Incorrect type '' provided to 'operating_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -515,12 +515,12 @@ def test__SphericalVessels_heayd_type_incorrect_value(self): Spherical_vessel = _SphericalVessels( ID=(4, "m"), length=(10, "m"), head_type="flatop") - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.head_type = "flatop" - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) @pytest.mark.negative @@ -531,22 +531,22 @@ def test__SphericalVessels_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative @@ -567,7 +567,7 @@ def test__SphericalVessels_get_inventory_incorrect_type_to_type(self): with pytest.raises(Exception) as exp: m4 = _SphericalVessels() m4.get_inventory([]) - self.assertIn("Incorrect type '' provided to 'type'. Should be '", + self.assertIn("Incorrect type 'list' provided to 'type'. Should be 'str", str(exp)) @pytest.mark.negative @pytest.mark.get_inventory diff --git a/tests/test_equipments/test__VerticalVessels.py b/tests/test_equipments/test__VerticalVessels.py index cb0edde..ddc2457 100644 --- a/tests/test_equipments/test__VerticalVessels.py +++ b/tests/test_equipments/test__VerticalVessels.py @@ -428,7 +428,7 @@ def test__VerticalVessels_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -436,7 +436,7 @@ def test__VerticalVessels_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -444,7 +444,7 @@ def test__VerticalVessels_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -452,7 +452,7 @@ def test__VerticalVessels_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -460,7 +460,7 @@ def test__VerticalVessels_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -468,7 +468,7 @@ def test__VerticalVessels_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -476,7 +476,7 @@ def test__VerticalVessels_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -484,7 +484,7 @@ def test__VerticalVessels_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -492,7 +492,7 @@ def test__VerticalVessels_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -500,7 +500,7 @@ def test__VerticalVessels_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -508,7 +508,7 @@ def test__VerticalVessels_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -516,7 +516,7 @@ def test__VerticalVessels_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -524,7 +524,7 @@ def test__VerticalVessels_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -533,12 +533,12 @@ def test__VerticalVessels_ID_incorrect_type_to_value(self): Veritcal_vessel = _VerticalVessels( ID=[4, "m"], length=(10, "m"), head_type="flat") - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.ID = [] - self.assertIn("Incorrect type '' provided to 'ID'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'ID'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -547,12 +547,12 @@ def test__VerticalVessels_length_incorrect_type_to_value(self): Veritcal_vessel = _VerticalVessels( ID=(4, "m"), length=[10, "m"], head_type="flat") - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.length = [] - self.assertIn("Incorrect type '' provided to 'length'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'length'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -561,12 +561,12 @@ def test__VerticalVessels_heayd_type_incorrect_type_to_value(self): Veritcal_vessel = _VerticalVessels( ID=(4, "m"), length=(10, "m"), head_type=["flat"]) - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.head_type = [] - self.assertIn("Incorrect type '' provided to 'head_type'. Should be ''", + self.assertIn("Incorrect type 'list' provided to 'head_type'. Should be 'str'", str(exp)) @pytest.mark.negative @@ -574,7 +574,7 @@ def test__VerticalVessels_LLLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.LLLL = [] - self.assertIn("Incorrect type '' provided to 'LLLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -582,7 +582,7 @@ def test__VerticalVessels_LLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.LLL = [] - self.assertIn("Incorrect type '' provided to 'LLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'LLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -590,7 +590,7 @@ def test__VerticalVessels_NLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.NLL = [] - self.assertIn("Incorrect type '' provided to 'NLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'NLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -598,7 +598,7 @@ def test__VerticalVessels_HLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.HLL = [] - self.assertIn("Incorrect type '' provided to 'HLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -606,7 +606,7 @@ def test__VerticalVessels_HHLL_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.HHLL = [] - self.assertIn("Incorrect type '' provided to 'HHLL'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'HHLL'. Should be '('Length', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -614,7 +614,7 @@ def test__VerticalVessels_operating_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.operating_temperature = [] - self.assertIn("Incorrect type '' provided to 'operating_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -622,7 +622,7 @@ def test__VerticalVessels_operating_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.operating_pressure = [] - self.assertIn("Incorrect type '' provided to 'operating_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'operating_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -631,12 +631,12 @@ def test__VerticalVessels_heayd_type_incorrect_value(self): Vertical_vessel = _VerticalVessels( ID=(4, "m"), length=(10, "m"), head_type="flatop") - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.head_type = "flatop" - self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'.\\n ", + self.assertIn("Incorrect value \'flatop\' provided to \'head_type\'. Should be among \'[\'hemispherical\', \'elliptical\', \'torispherical\', \'flat\']\'", str(exp)) @pytest.mark.negative @@ -647,22 +647,22 @@ def test__VerticalVessels_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative @@ -683,7 +683,7 @@ def test__VerticalVessels_get_inventory_incorrect_type_to_type(self): with pytest.raises(Exception) as exp: m4 = _VerticalVessels() m4.get_inventory([]) - self.assertIn("Incorrect type '' provided to 'type'. Should be '", + self.assertIn("Incorrect type 'list' provided to 'type'. Should be 'str", str(exp)) @pytest.mark.negative @pytest.mark.get_inventory diff --git a/tests/test_instruments/test_ControlValve.py b/tests/test_instruments/test_ControlValve.py index 0a9a138..ef669d7 100644 --- a/tests/test_instruments/test_ControlValve.py +++ b/tests/test_instruments/test_ControlValve.py @@ -269,7 +269,7 @@ def test_ControlValve_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -277,7 +277,7 @@ def test_ControlValve_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -285,7 +285,7 @@ def test_ControlValve_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -293,7 +293,7 @@ def test_ControlValve_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -301,7 +301,7 @@ def test_ControlValve_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -309,7 +309,7 @@ def test_ControlValve_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -317,7 +317,7 @@ def test_ControlValve_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -325,7 +325,7 @@ def test_ControlValve_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -333,7 +333,7 @@ def test_ControlValve_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -341,7 +341,7 @@ def test_ControlValve_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -349,7 +349,7 @@ def test_ControlValve_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -357,7 +357,7 @@ def test_ControlValve_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -365,7 +365,7 @@ def test_ControlValve_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = ControlValve() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -377,22 +377,22 @@ def test_ControlValve_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_instruments/test_FlowMeter.py b/tests/test_instruments/test_FlowMeter.py index 6ab64c8..b981271 100644 --- a/tests/test_instruments/test_FlowMeter.py +++ b/tests/test_instruments/test_FlowMeter.py @@ -242,7 +242,7 @@ def test_FlowMeter_inlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.inlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'inlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -250,7 +250,7 @@ def test_FlowMeter_outlet_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.outlet_pressure = [] - self.assertIn("Incorrect type '' provided to 'outlet_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -258,7 +258,7 @@ def test_FlowMeter_pressure_drop_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.pressure_drop = [] - self.assertIn("Incorrect type '' provided to 'pressure_drop'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure_drop'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -266,7 +266,7 @@ def test_FlowMeter_design_pressure_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.design_pressure = [] - self.assertIn("Incorrect type '' provided to 'design_pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -274,7 +274,7 @@ def test_FlowMeter_inlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.inlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'inlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -282,7 +282,7 @@ def test_FlowMeter_outlet_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.outlet_temperature = [] - self.assertIn("Incorrect type '' provided to 'outlet_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -290,7 +290,7 @@ def test_FlowMeter_temperature_decrease_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.temperature_decrease = [] - self.assertIn("Incorrect type '' provided to 'temperature_decrease'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_decrease'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -298,7 +298,7 @@ def test_FlowMeter_temperature_increase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.temperature_increase = [] - self.assertIn("Incorrect type '' provided to 'temperature_increase'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature_increase'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -306,7 +306,7 @@ def test_FlowMeter_design_temperature_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.design_temperature = [] - self.assertIn("Incorrect type '' provided to 'design_temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'design_temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -314,7 +314,7 @@ def test_FlowMeter_inlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.inlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'inlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'inlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -322,7 +322,7 @@ def test_FlowMeter_outlet_mass_flowrate_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.outlet_mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'outlet_mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'outlet_mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -330,7 +330,7 @@ def test_FlowMeter_energy_in_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.energy_in = [] - self.assertIn("Incorrect type '' provided to 'energy_in'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_in'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -338,7 +338,7 @@ def test_FlowMeter_energy_out_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = FlowMeter() m4.energy_out = [] - self.assertIn("Incorrect type '' provided to 'energy_out'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'energy_out'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative @@ -349,22 +349,22 @@ def test_FlowMeter_stream_connecion_disconnection_incorrect_type(self): with pytest.raises(Exception) as exp: cv.connect_stream([inlet_stream], 'in', stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'stream_object\'. Should be \'(, )\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_object\'. Should be \'('MaterialStream', 'EnergyStream')\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, ['in'], stream_governed=True) - self.assertIn("Incorrect type \'\' provided to \'direction\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'direction\'. Should be \'str\'", str(exp)) with pytest.raises(Exception) as exp: cv.connect_stream(inlet_stream, 'in', stream_governed=[True]) - self.assertIn("Incorrect type \'\' provided to \'stream_governed\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_governed\'. Should be \'bool\'", str(exp)) cv.connect_stream(inlet_stream, 'in', stream_governed=True) with pytest.raises(Exception) as exp: cv.disconnect_stream(stream_tag=["Inlet_cv_19"]) - self.assertIn("Incorrect type \'\' provided to \'stream_tag\'. Should be \'\'.\\n ", + self.assertIn("Incorrect type \'list\' provided to \'stream_tag\'. Should be \'str\'", str(exp)) @pytest.mark.negative diff --git a/tests/test_properties/test_properties.py b/tests/test_properties/test_properties.py index 61c4872..f77dd35 100644 --- a/tests/test_properties/test_properties.py +++ b/tests/test_properties/test_properties.py @@ -31,23 +31,23 @@ def test_Length_incorrect_instantiation(): def test_Length_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Length([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Length_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.Length(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_Time_instantiation_conversion(): @@ -76,21 +76,21 @@ def test_Time_incorrect_instantiation(): def test_Time_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Time([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Time() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Time_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.Time(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Time() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_Pressure_instantiation_conversion(): @@ -119,22 +119,22 @@ def test_Pressure_incorrect_instantiation_conversion(): def test_Pressure_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Pressure([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Pressure() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Pressure_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.Pressure(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_Temperature_instantiation_conversion(): @@ -169,21 +169,21 @@ def test_Temperature_incorrect_instantiation_conversion(): def test_Temperature_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Temperature([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Temperature() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Temperature_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.Temperature(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Temperature() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_MassFlowRate_instantiation_conversion(): @@ -216,22 +216,22 @@ def test_MassFlowRate_incorrect_instantiatio_conversion(): def test_MassFlowRate_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.MassFlowRate([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.MassFlowRate() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_MassFlowRate_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.MassFlowRate(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.MassFlowRate() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_MolarFlowRate_instantiation_conversion(): @@ -261,22 +261,22 @@ def test_MolarFlowRate_incorrect_instantiation_conversion(): def test_MolarFlowRate_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.MolarFlowRate([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.MolarFlowRate() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_MolarFlowRate_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.MolarFlowRate(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_VolumeFlowRate_instantiation_conversion(): @@ -305,22 +305,22 @@ def test_VolumeFlowRate_incorrect_instantiation_conversion(): def test_VolumetricFlowRate_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.VolumetricFlowRate([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.VolumetricFlowRate() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_VolumetricFlowRate_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.VolumetricFlowRate(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_Power_instantiation_conversion(): @@ -358,21 +358,21 @@ def test_Power_instantiation_conversion(): def test_Power_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Power([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Power() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Power_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.Power(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Power() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive @@ -389,22 +389,22 @@ def test_property_density(): def test_Density_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Density([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Density() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Desnisty_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.Density(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.positive def test_property_dviscosity(): @@ -418,22 +418,22 @@ def test_property_dviscosity(): def test_DViscosity_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.DViscosity([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.DViscosity() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_DViscosity_incorrect_type_to_unit(): with pytest.raises(Exception) as exp: properties.DViscosity(10, 10) - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) with pytest.raises(Exception) as exp: l = properties.Length() l.unit = 10 - assert "Incorrect type '' provided to 'unit'. Should be ''." in str(exp) + assert "Incorrect type 'int' provided to 'unit'. Should be 'str'." in str(exp) @pytest.mark.addition def test_property_addition(): @@ -547,7 +547,7 @@ def test_time_series_incorrect_type_to_value(): with pytest.raises(Exception) as exp: l = properties.Length(10) l.time_series = [] - assert "Incorrect type 'list' provided to 'time_series'. Should be '(, , )" in str(exp) + assert "Incorrect type 'list' provided to 'time_series'. Should be '('Series', 'DataFrame', 'dict')" in str(exp) @pytest.mark.positive def test_property_Efficiency(): @@ -560,11 +560,11 @@ def test_property_Efficiency(): def test_Efficiency_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Efficiency([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Efficiency() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Efficiency_setting_unit(): @@ -586,11 +586,11 @@ def test_property_Dimensionless(): def test_Dimensionless_incorrect_type_to_value(): with pytest.raises(Exception) as exp: properties.Dimensionless([10]) - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) with pytest.raises(Exception) as exp: l = properties.Dimensionless() l.value = [] - assert "Incorrect type 'list' provided to 'value'. Should be '(, )" in str(exp) + assert "Incorrect type 'list' provided to 'value'. Should be '('int', 'float')" in str(exp) @pytest.mark.negative def test_Dimensionless_setting_unit(): diff --git a/tests/test_streams/test_EnergyStream.py b/tests/test_streams/test_EnergyStream.py index 8fdc3df..3b9b4e3 100644 --- a/tests/test_streams/test_EnergyStream.py +++ b/tests/test_streams/test_EnergyStream.py @@ -32,13 +32,13 @@ def test_EnergyStream_object_representation(self): def test_EnergyStream_incorrect_assignment(self): with pytest.raises(Exception) as exp: e5 = EnergyStream("gggg", []) - self.assertIn("Incorrect type '' provided to 'amount'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'amount'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: e5 = EnergyStream() e5.amount = [] - self.assertIn("Incorrect type '' provided to 'amount'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'amount'. Should be '('Power', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.delete diff --git a/tests/test_streams/test_MaterialStream.py b/tests/test_streams/test_MaterialStream.py index c37204e..2648b58 100644 --- a/tests/test_streams/test_MaterialStream.py +++ b/tests/test_streams/test_MaterialStream.py @@ -130,9 +130,9 @@ def test_MaterialStream_components_thermodynamic_property_compressibility_factor p = prop.Pressure(10, 'bar') p.unit = 'Pa' mx = Mixture(zs=mol_fraction, T=300, P=p.value) - self.assertEqual(m4.Z, mx.Z) - self.assertEqual(m4.Z_l, mx.Zl) - self.assertEqual(m4.Z_g, mx.Zg) + self.assertEqual(m4.Z.value, mx.Z) + self.assertEqual(m4.Z_l.value, mx.Zl) + self.assertEqual(m4.Z_g.value, mx.Zg) @pytest.mark.positive def test_MaterialStream_components_thermodynamic_property_isentropic_exponent(self): @@ -145,7 +145,7 @@ def test_MaterialStream_components_thermodynamic_property_isentropic_exponent(se p = prop.Pressure(10, 'bar') p.unit = 'Pa' mx = Mixture(zs=mol_fraction, T=300, P=p.value) - self.assertEqual(m4.isentropic_exponent, mx.isentropic_exponent) + self.assertEqual(m4.isentropic_exponent.value, mx.isentropic_exponent) @pytest.mark.positive def test_MaterialStream_components_thermodynamic_property_phase(self): @@ -183,12 +183,12 @@ def test_MaterialStream_pressure_incorrect_type_to_value(self): m4 = MaterialStream(pressure=[10], temperature=300, mass_flowrate=prop.MassFlowRate(1000, "kg/h")) - self.assertIn("Incorrect type '' provided to 'pressure'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.pressure = [] - self.assertIn("Incorrect type '' provided to 'pressure'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'pressure'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_temperature_incorrect_type_to_value(self): @@ -196,12 +196,12 @@ def test_MaterialStream_temperature_incorrect_type_to_value(self): m4 = MaterialStream(pressure=10, temperature=[300], mass_flowrate=prop.MassFlowRate(1000, "kg/h")) - self.assertIn("Incorrect type '' provided to 'temperature'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.temperature = [] - self.assertIn("Incorrect type '' provided to 'temperature'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'temperature'. Should be '('Temperature', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_mass_flowrate_incorrect_type_to_value(self): @@ -209,124 +209,124 @@ def test_MaterialStream_mass_flowrate_incorrect_type_to_value(self): m4 = MaterialStream(pressure=10, temperature=300, mass_flowrate=[]) - self.assertIn("Incorrect type '' provided to 'mass_flowrate'. Should be '(, , , )'", + self.assertIn("Incorrect type 'list' provided to 'mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.mass_flowrate = [] - self.assertIn("Incorrect type '' provided to 'mass_flowrate'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'mass_flowrate'. Should be '('MassFlowRate', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_molecular_weigth_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.molecular_weight = [] - self.assertIn("Incorrect type '' provided to 'molecular_weight'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'molecular_weight'. Should be '('MolecularWeigth', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_components_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.components = [] - self.assertIn("Incorrect type '' provided to 'components'. Should be ''", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'components'. Should be 'Components'", str(exp)) @pytest.mark.negative def test_MaterialStream_desnity_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.density = [] - self.assertIn("Incorrect type '' provided to 'density'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'density'. Should be '('Density', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_desnity_l_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.density_l = [] - self.assertIn("Incorrect type '' provided to 'density_l'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'density_l'. Should be '('Density', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_desnity_g_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.density_g = [] - self.assertIn("Incorrect type '' provided to 'density_g'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'density_g'. Should be '('Density', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_desnity_s_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.density_s = [] - self.assertIn("Incorrect type '' provided to 'density_s'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'density_s'. Should be '('Density', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_d_viscosity_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.d_viscosity = [] - self.assertIn("Incorrect type '' provided to 'd_viscosity'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'd_viscosity'. Should be '('DViscosity', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_d_viscosity_l_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.d_viscosity_l = [] - self.assertIn("Incorrect type '' provided to 'd_viscosity_l'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'd_viscosity_l'. Should be '('DViscosity', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_d_viscosity_g_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.d_viscosity_g = [] - self.assertIn("Incorrect type '' provided to 'd_viscosity_g'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'd_viscosity_g'. Should be '('DViscosity', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_isentropic_exponent_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.isentropic_exponent = [] - self.assertIn("Incorrect type '' provided to 'isentropic_exponent'. Should be '(, )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'isentropic_exponent'. Should be '('Dimensionless', 'int', 'float')'", str(exp)) @pytest.mark.negative def test_MaterialStream_phase_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.phase = [] - self.assertIn("Incorrect type '' provided to 'phase'. Should be ''", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'phase'. Should be 'str'", str(exp)) @pytest.mark.negative def test_MaterialStream_Z_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.Z = [] - self.assertIn("Incorrect type '' provided to 'Z'. Should be '(, )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'Z'. Should be '('Dimensionless', 'int', 'float')'", str(exp)) @pytest.mark.negative def test_MaterialStream_Z_g_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.Z_g = [] - self.assertIn("Incorrect type '' provided to 'Z_g'. Should be '(, )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'Z_g'. Should be '('Dimensionless', 'int', 'float')'", str(exp)) @pytest.mark.negative def test_MaterialStream_Z_l_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.Z_l = [] - self.assertIn("Incorrect type '' provided to 'Z_l'. Should be '(, )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'Z_l'. Should be '('Dimensionless', 'int', 'float')'", str(exp)) @pytest.mark.negative def test_MaterialStream_Pc_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.Pc = [] - self.assertIn("Incorrect type '' provided to 'Pc'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'Pc'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.negative def test_MaterialStream_Psat_incorrect_type_to_value(self): with pytest.raises(Exception) as exp: m4 = MaterialStream() m4.Psat = [] - self.assertIn("Incorrect type '' provided to 'Psat'. Should be '(, , , )'", str(exp)) + self.assertIn("Incorrect type 'list' provided to 'Psat'. Should be '('Pressure', 'int', 'float', 'tuple')'", str(exp)) @pytest.mark.delete def test_MaterialStream_stream_equipment_delete_without_connection(self): From 19168479018b914d8e1714799ded22b4e0052bbb Mon Sep 17 00:00:00 2001 From: abhishekvraman Date: Sat, 18 Mar 2023 12:26:57 +0530 Subject: [PATCH 4/4] updating license and workflow and docstring. --- .github/workflows/build-windows.yml | 2 +- LICENSE | 2 +- setup.cfg | 2 +- src/propylean/streams.py | 236 +++++++++++++++++++++++----- src/propylean/validators.py | 1 - 5 files changed, 203 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index d5a392e..dff9f30 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -35,7 +35,7 @@ jobs: git clone https://github.com/abhishekvraman/Propylean.git cd Propylean python -m build - python -m pip install dist/propylean-0.2.4-py3-none-any.whl + python -m pip install dist/propylean-0.2.5-py3-none-any.whl - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/LICENSE b/LICENSE index 5e70a36..1969c3e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2022, 2021 Abhishek V Raman +Copyright (c) 2023, 2022, 2021 Abhishek Venkitta Raman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/setup.cfg b/setup.cfg index b0d1a4d..7fa17b1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = propylean -version = 0.2.4 +version = 0.2.5 author = Abhishek V Raman author_email = description = The open-source calculations and analytics package for chemical process industries. diff --git a/src/propylean/streams.py b/src/propylean/streams.py index 3e41d60..f4213dd 100644 --- a/src/propylean/streams.py +++ b/src/propylean/streams.py @@ -4,7 +4,6 @@ from statistics import fmean class Stream(object): - def __init__(self, tag=None, **inputs) -> None: self._tag = None self._to_equipment_tag = None @@ -79,6 +78,40 @@ def _tuple_property_value_unit_returner(self, value, property_type): class EnergyStream(Stream): items = [] def __init__(self, tag=None, amount=(0, 'W')): + """ + DESCRIPTION: + Final class for creating objects to represent material + which is flows in a process plant. + + PARAMETERS: + tag: + Required: No + Type: string + Acceptable values: Tag which is not assigned. + Description: Tag to be given to a material stream. + + amount: + Required: No + Type: int/float or tuple(value, unit) or Power(recommended) + Default value: 0 W + Description: Specifies the rate of energy or Power. + + RETURN VALUE: + Type: EnergyStream + Description: Returns an object of type EnergyStream which is equivalent + energy flowrate or Power. + + ERROR RAISED: + Type: + Description: + + SAMPLE USE CASES: + from propylean.streams import EnergyStream + # or + from propylean import EnergyStream + heating = EnergyStream(tag="stream heating") + heating.amount = prop.Power(25, "C") + """ super().__init__(tag) self._amount = prop.Power() self.amount = amount @@ -142,41 +175,172 @@ def delete(self): class MaterialStream(Stream): property_package = None items = [] - def __init__(self,tag = None, - mass_flowrate = 0, - pressure = 101325, - temperature = 298): - - super().__init__(tag) - self._mass_flowrate = prop.MassFlowRate() - self._pressure = prop.Pressure() - self._temperature = prop.Temperature() - - self.mass_flowrate = mass_flowrate - self.temperature = temperature - self.pressure = pressure - self._density = prop.Density() - self._density_l = prop.Density() - self._density_g = prop.Density() - self._density_s = prop.Density() - self._d_viscosity = prop.DViscosity() - self._d_viscosity_l = prop.DViscosity() - self._d_viscosity_g = prop.DViscosity() - self._components = prop.Components() - - self._vol_flowrate = prop.VolumetricFlowRate() - self._mol_flowrate = prop.MolarFlowRate() - self._molecular_weight = prop.MolecularWeigth() - self._Z = 1 - self._Z_g = 1 - self._Z_l = 0 - self._isentropic_exponent = 1.3 - self._phase = None - self._Psat = None - self._Pc = None - - self._index = len(MaterialStream.items) - MaterialStream.items.append(self) + def __init__(self, tag=None, mass_flowrate=0, pressure=101325, + temperature=298): + """ + DESCRIPTION: + Final class for creating objects to represent material + which is flows in a process plant. + + PARAMETERS: + tag: + Required: No + Type: string + Acceptable values: Tag which is not assigned. + Description: Tag to be given to a material stream. + + mass_flowrate: + Required: No + Type: int/float or tuple(value, unit) or MassFlowRate(recommended) + Default value: 0 kg/s + Description: Specifies the mass flowrate of the material. + + pressure: + Required: No + Type: int/float or tuple(value, unit) or Pressure(recommended) + Default value: 0 kg/s + Description: Specifies the pressure of the material stream. + + Temperature: + Required: No + Type: int/float or tuple(value, unit) or Temperature(recommended) + Default value: 0 kg/s + Description: Specifies the temperature of the material stream. + + + PROPERTIES: + mol_flowrate: + The molar flowrate of the material stream. + This property cannot be set but is derived from mass flowrate and molecular weight. + Type: MolarFlowRate + + vol_flowrate: + The volumetic flowrate of the material stream. + This property cannot be set but is derived from masnn flowrate and density. + Type: VolFlowRate + + Pc: + Critical pressure of the material stream. + Type: Pressure + + Psat: + Saturation pressure of the material stream. + Type: Pressure + + Z_g: + The gas phase compressibility of the material stream. + Type: Dimensionless + + Z_l: + The liquid phase compressibility of the material stream. + Type: Dimensionless + + components: + The components of the mixture in the material stream. Can be mixture of various pure compunds in mol fraction, mass fraction or volume fraction. Set this property using propylean.properties.components class. + Type: Components + + d_viscosity: + The dynamic viscosity of the material stream in mixed phase. + Type: DViscosity + + d_viscosity_g: + The dynamic viscosity of the material stream in gas phase. + Type: DViscosity + + d_viscosity_l: + The dynamic viscosity of the material stream in liquid phase. + Type: DViscosity + + density: + The density of the material stream in mixed phase. + Type: Density + + density_g: + The density of the material stream in gas phase. + Type: Density + + density_l: + The density of the material stream in liquid phase. + Type: Density + + isentropic_exponent: + The isentropic exponent or the specific heat ratio (Cp/Cv) of the material stream. + Type: Dimensionless + + mass_flowrate: + Mass flowrate of the material stream. + Type: MassFlowRate + + molecular_weight: + The molecular weight of the material stream. + Type: MassFlowRate + + phase: + The phase of the material stream. "l" for liguid, "g" for gas, "l/g" for mixed phase as per fluids package. + Type: String + + pressure: + The pressure of the material stream. It is recommended to set it to help derive other properties. + Type: Pressure + + temperature: + The temperature of the material stream. It is recommended to set it to help derive other properties. + Type: Temperature + + + RETURN VALUE: + Type: MaterialStream + Description: Returns an object of type MaterialStream with all properties of + a material flowing in a process plants. + + ERROR RAISED: + Type: + Description: + + SAMPLE USE CASES: + from propylean.streams import MaterialStream + # or + from propylean import MaterialStream + from propylean import properties as prop + sour_gas = MaterialStream(tag="sour_gas_from_fields") + sour_gas.temperature = prop.Temperature(25, "C") + sour_gas.pressure = prop.Pressure(75, "bar") + mol_fractions = {"methane": 0.95, "Ethane": 0.2, "Butane": 0.1, "Propane": 0.05, "water":0.05, "Hydrogen Sulphide": 0.01} + sour_gas.components = prop.Components(mol_fractions, type="mol") + + # Get the density of the sour_gas MaterialStream. + print(sour_gas.density) + """ + super().__init__(tag) + self._mass_flowrate = prop.MassFlowRate() + self._pressure = prop.Pressure() + self._temperature = prop.Temperature() + + self.mass_flowrate = mass_flowrate + self.temperature = temperature + self.pressure = pressure + self._density = prop.Density() + self._density_l = prop.Density() + self._density_g = prop.Density() + self._density_s = prop.Density() + self._d_viscosity = prop.DViscosity() + self._d_viscosity_l = prop.DViscosity() + self._d_viscosity_g = prop.DViscosity() + self._components = prop.Components() + + self._vol_flowrate = prop.VolumetricFlowRate() + self._mol_flowrate = prop.MolarFlowRate() + self._molecular_weight = prop.MolecularWeigth() + self._Z = 1 + self._Z_g = 1 + self._Z_l = 0 + self._isentropic_exponent = 1.3 + self._phase = None + self._Psat = None + self._Pc = None + + self._index = len(MaterialStream.items) + MaterialStream.items.append(self) @property def pressure(self): diff --git a/src/propylean/validators.py b/src/propylean/validators.py index 583d2e7..f551d82 100644 --- a/src/propylean/validators.py +++ b/src/propylean/validators.py @@ -35,7 +35,6 @@ def validate_arg_prop_value_list(cls, arg_prop_name, value, correct_values): DESCRIPTION: Function to validate values passed to properties or args is correct from list of values. - . PARAMETERS: arg_prop_name: Required: Yes