Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
azaroth42 committed Sep 5, 2018
1 parent 95b583b commit 168cf61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/test_model.py
Expand Up @@ -166,7 +166,7 @@ def test_external(self):
class TestProcessTSV(unittest.TestCase):

def test_process_tsv(self):
expect = {u'subs': [u'E84_Information_Carrier', u'ore:Proxy'], u'label': u'Man-Made Object', u'className': u'ManMadeObject',
expect = {u'subs': [u'E84_Information_Carrier'], u'label': u'Man-Made Object', u'className': u'ManMadeObject',
u'subOf': u'E19_Physical_Object|E24_Physical_Man-Made_Thing', u'props': [], u'class': None, u'okay': u'1'}
fn = 'cromulent/data/crm_vocab.tsv'
vocabData = model.process_tsv(fn)
Expand Down
23 changes: 6 additions & 17 deletions tests/test_vocab.py
Expand Up @@ -13,27 +13,16 @@ def tearDown(self):
pass

def test_class(self):
vocab.register_aat_class("TestObject1", model.ManMadeObject, "1")
vocab.register_aat_class("TestObject1", model.ManMadeObject, "1", "example 1")
from cromulent.vocab import TestObject1
self.assertEqual(TestObject1._classification, "aat:1")
self.assertEqual(TestObject1._classification.id, "aat:1")

def test_material(self):
vocab.register_aat_material("TestMaterial2", "2")
self.assertTrue('TestMaterial2' in vocab.materialTypes)
tm2 = vocab.materialTypes['TestMaterial2']
def test_instance(self):
vocab.register_instance("TestMaterial2", model.Material, "2", "example 2")
self.assertTrue('TestMaterial2' in vocab.instances)
tm2 = vocab.instances['TestMaterial2']
self.assertEqual(tm2.id, "aat:2")

def test_unit(self):
vocab.register_aat_dimensionUnit("TestUnit4", "4")
self.assertTrue('TestUnit4' in vocab.dimensionUnits)
tu4 = vocab.dimensionUnits['TestUnit4']
self.assertEqual(tu4.id, "aat:4")

def test_type_patch(self):
t = model.Type("http://vocab.getty.edu/aat/5")
nt = t._toJSON()
self.assertEqual(nt, "aat:5")

def test_art_setter(self):
p = model.ManMadeObject("a", art=1)
p.label = "a"
Expand Down

0 comments on commit 168cf61

Please sign in to comment.