Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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']
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 def test_eq_fail(self):
     con = metocean.Concept(self.con.uri, 'scheme',
                            stock.property_component_cf())
     self.assertNotEqual(self.con, con)
Exemplo n.º 5
0
 def test_eq_pass(self):
     self.assertEqual(self.pcomp, stock.property_component_cf())
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 def test_eq_pass_compound(self):
     cprop = metocean.Property('uri', 'name',
                               stock.property_component_cf(),
                               'operator')
     self.assertEqual(self.cprop, cprop)