Skip to content

Commit e7e74af

Browse files
committed
[test/property] Add comparison test
1 parent 4a0209c commit e7e74af

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/test_property.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,30 @@ def test_get_merged_equivalent(self):
650650
self.assertIsNotNone(prop.get_merged_equivalent())
651651
self.assertEqual(prop.get_merged_equivalent(), merprop)
652652

653+
def test_comparison(self):
654+
p_name = "propertyName"
655+
p_origin = "from over there"
656+
p_unit = "pears"
657+
p_uncertainty = "+-12"
658+
p_ref = "4 8 15 16 23"
659+
p_def = "an odml test property"
660+
p_dep = "yes"
661+
p_dep_val = "42"
662+
p_val = ["a", "b"]
663+
664+
prop_a = Property(name=p_name, value_origin=p_origin, unit=p_unit,
665+
uncertainty=p_uncertainty, reference=p_ref, definition=p_def,
666+
dependency=p_dep, dependency_value=p_dep_val, value=p_val)
667+
668+
prop_b = Property(name=p_name, value_origin=p_origin, unit=p_unit,
669+
uncertainty=p_uncertainty, reference=p_ref, definition=p_def,
670+
dependency=p_dep, dependency_value=p_dep_val, value=p_val)
671+
672+
self.assertEqual(prop_a, prop_b)
673+
674+
prop_b.name = 'newPropertyName'
675+
self.assertNotEqual(prop_a, prop_b)
676+
653677

654678
if __name__ == "__main__":
655679
print("TestProperty")

0 commit comments

Comments
 (0)