def test_remove_tmp(self): testWork = Work() testWork.createTmpRelations({}) testWork.tmp_links = ['link1', 'link2'] testWork.removeTmpRelations() with self.assertRaises(AttributeError): tmpLinks = testWork.tmp_links
def test_create_tmp(self): workData = { 'links': ['link1', 'link2'], 'identifiers': ['id1', 'id2', 'id3'] } testWork = Work() testWork.createTmpRelations(workData) self.assertEqual(testWork.tmp_identifiers[1], 'id2') self.assertEqual(len(testWork.tmp_links), 2) self.assertEqual(testWork.links, set())