def test_eq_fail(self): comp = metocean.Component('uri', stock.property_component_cf()) self.assertNotEqual(self.comp, comp) components = [stock.simple_component_cf(), stock.compound_component_cf()] comp = metocean.Component(self.comp.uri, components) self.assertNotEqual(self.comp, comp) properties = stock.property_component_cf().values() pcomp = metocean.PropertyComponent('uri', properties) comp = metocean.Component(self.comp.uri, pcomp) self.assertNotEqual(self.comp, comp)
def test_getitem(self): prop = stock.property_cf_standard_name() self.assertEqual(self.comp[prop.name], prop) self.assertEqual(self.comp[prop.name.notation], prop) self.assertEqual(self.comp[0], stock.property_component_cf()) self.assertIsNone(self.comp['wibble']) self.assertEqual(self.ccomp[0], stock.simple_component_cf()) with self.assertRaises(TypeError): self.ccomp[prop.name] with self.assertRaises(TypeError): self.ccomp[prop.name.notation] with self.assertRaises(TypeError): self.ccomp['wibble']
def setUp(self): self.prop = stock.property_cf_standard_name() self.uri, self.name, self.value, self.operator = self.prop self.cprop = metocean.Property('uri', 'name', stock.property_component_cf(), 'operator')
def test_eq_fail(self): con = metocean.Concept(self.con.uri, 'scheme', stock.property_component_cf()) self.assertNotEqual(self.con, con)
def test_eq_pass(self): self.assertEqual(self.pcomp, stock.property_component_cf())
def setUp(self): self.pcomp = stock.property_component_cf() cprop = metocean.Property('uri', 'name', stock.property_component_cf(), 'operator') self.cpcomp = metocean.PropertyComponent('uri', cprop)
def test_eq_pass_compound(self): cprop = metocean.Property('uri', 'name', stock.property_component_cf(), 'operator') self.assertEqual(self.cprop, cprop)