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'
def test_no_label(self): u = IoosUrn(asset_type='station', authority='me') assert u.urn is None
def test_station_cant_have_component(self): u = IoosUrn(asset_type='station', component='something') assert u.urn is None
def test_constructor_with_bad_data(self): u = IoosUrn(notanattribute='foo') assert u.urn is None
def test_constructor_no_data(self): u = IoosUrn() assert u.urn is None
def test_args(self): u = IoosUrn(asset_type='sensor', authority='me', label='mysupersensor') assert u.urn == 'urn:ioos:sensor:me:mysupersensor'