def test_matchLocalInstance_no_match(self): testDict = {'test/1': 'inst1', 'test/2': 'inst1', 'test/4': 'inst3'} testInstance = { 'identifiers': [{ 'type': 'other', 'identifier': 1 }, { 'type': 'other', 'identifier': 2 }] } testWork = Work() matchedInstance = testWork.matchLocalInstance(testInstance, testDict) self.assertEqual(matchedInstance, None)
def test_matchLocalInstance_found_multiple(self): testDict = {'test/1': 'inst1', 'test/2': 'inst1', 'test/4': 'inst3'} testInstance = { 'identifiers': [{ 'type': 'test', 'identifier': 1 }, { 'type': 'test', 'identifier': 4 }, { 'type': 'test', 'identifier': 2 }] } testWork = Work() matchedInstance = testWork.matchLocalInstance(testInstance, testDict) self.assertEqual(matchedInstance, 'inst1')