Example #1
0
    def test_setattr(self):
        u = IoosUrn()
        u.asset_type = 'sensor'
        u.authority = 'me'
        u.label = 'mysupersensor'
        assert u.urn == 'urn:ioos:sensor:me:mysupersensor'

        u.discriminant = 'abc'
        assert u.urn == 'urn:ioos:sensor:me:mysupersensor:abc'

        u.component = 'temp'
        assert u.urn == 'urn:ioos:sensor:me:mysupersensor:temp:abc'
Example #2
0
 def test_no_label(self):
     u = IoosUrn(asset_type='station', authority='me')
     assert u.urn is None
Example #3
0
 def test_station_cant_have_component(self):
     u = IoosUrn(asset_type='station', component='something')
     assert u.urn is None
Example #4
0
 def test_constructor_with_bad_data(self):
     u = IoosUrn(notanattribute='foo')
     assert u.urn is None
Example #5
0
 def test_constructor_no_data(self):
     u = IoosUrn()
     assert u.urn is None
Example #6
0
 def test_args(self):
     u = IoosUrn(asset_type='sensor', authority='me', label='mysupersensor')
     assert u.urn == 'urn:ioos:sensor:me:mysupersensor'