示例#1
0
    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())
示例#2
0
    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')