def test_update_instance_err(self, mockInst): testWork = Work() testWork.session = 'session' mockInst.update.side_effect = DataError('test err') testWork.updateInstance(mockInst, 'inst1') self.assertEqual(testWork.instances, set())
def test_update_instance(self, mockInst): testWork = Work() testWork.epubsToLoad = [] testWork.session = 'session' testWork.updateInstance(mockInst, 'newInst') mockInst.update.assert_called_once_with('session', 'newInst')