def test_is_type_name_strict_true(self): t_liquid = RxType("liquid") t_water = RxType("water", t_liquid) t_lake_actual = RxType("lake", t_water) t_lake_painting = RxType("lake") self.assertTrue(t_lake_actual.is_type_name("lake", strict=True)) self.assertTrue(t_lake_painting.is_type_name("lake", strict=True))
def test_is_type_name_false_hierarchy(self): t_liquid = RxType("liquid") t_water = RxType("water", t_liquid) t_lake = RxType("lake", t_water) self.assertFalse(t_liquid.is_type_name("water")) self.assertFalse(t_liquid.is_type_name("lake")) self.assertFalse(t_water.is_type_name("lake"))
def test_is_type_name_true(self): t_liquid = RxType("liquid") t_water = RxType("water", t_liquid) t_lake = RxType("lake", t_water) self.assertTrue(t_water.is_type_name("liquid")) self.assertTrue(t_lake.is_type_name("water")) self.assertTrue(t_lake.is_type_name("liquid"))
def test_is_type_name_strict_false(self): t_liquid = RxType("liquid") t_solid = RxType("solid") t_water = RxType("water", t_liquid) t_lake = RxType("lake", t_water) self.assertFalse(t_liquid.is_type_name("water", strict=True)) self.assertFalse(t_water.is_type_name("liquid", strict=True)) self.assertFalse(t_water.is_type_name("lake", strict=True)) self.assertFalse(t_lake.is_type_name("water", strict=True)) self.assertFalse(t_liquid.is_type_name("lake", strict=True)) self.assertFalse(t_lake.is_type_name("liquid", strict=True)) self.assertFalse(t_liquid.is_type_name("solid", strict=True)) self.assertFalse(t_solid.is_type_name("liquid", strict=True)) self.assertFalse(t_solid.is_type_name("lake", strict=True)) self.assertFalse(t_lake.is_type_name("solid", strict=True))
def test_is_type_name_false_unrelated(self): t_solid = RxType("solid") t_liquid = RxType("liquid") t_water = RxType("water", t_liquid) t_lake = RxType("lake", t_water) self.assertFalse(t_liquid.is_type_name("solid")) self.assertFalse(t_water.is_type_name("solid")) self.assertFalse(t_lake.is_type_name("solid")) self.assertFalse(t_solid.is_type_name("liquid")) self.assertFalse(t_solid.is_type_name("water")) self.assertFalse(t_solid.is_type_name("lake"))