def test_constructor(self): m1_param = ModuleParam( val="1.2", type="Float", alias="", ) m1_function = ModuleFunction( name="value", parameters=[m1_param], ) m1 = Module( id=0, name='Float', functions=[m1_function], ) m2 = Module() m2.name = "Float" m2.id = 0 f = ModuleFunction() f.name = "value" m2.functions.append(f) param = ModuleParam() param.strValue = "1.2" param.type = "Float" param.alias = "" f.params.append(param) assert m1 == m2
def test_constructor(self): m1_param = ModuleParam(val="1.2", type="Float", alias="", ) m1_function = ModuleFunction(name="value", parameters=[m1_param], ) m1 = Module(id=0, name='Float', functions=[m1_function], ) m2 = Module() m2.name = "Float" m2.id = 0 f = ModuleFunction() f.name = "value" m2.functions.append(f) param = ModuleParam() param.strValue = "1.2" param.type = "Float" param.alias = "" f.params.append(param) assert m1 == m2
def testComparisonOperators(self): f = ModuleFunction() f.name = "value" param = ModuleParam() param.strValue = "1.2" param.type = "Float" param.alias = "" f.addParameter(param) g = ModuleFunction() g.name = "value" param = ModuleParam() param.strValue = "1.2" param.type = "Float" param.alias = "" g.addParameter(param) assert f == g param = ModuleParam() param.strValue = "1.2" param.type = "Float" param.alias = "" g.addParameter(param) assert f != g