def test_commit_not_found(self, unlink): sn = '123' path = '/tmp/123' p = Pending('') p.journal = {sn: path} p.commit('invalid') self.assertFalse(unlink.called) self.assertEqual(p.journal, {sn: path})
def test_commit(self, unlink): sn = '123' path = '/tmp/123' p = Pending('') p.journal = {sn: path} p.commit(sn) unlink.assert_called_once_with(path) self.assertEqual(p.journal, {})