示例#1
0
 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})
示例#2
0
 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})
示例#3
0
 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, {})
示例#4
0
 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, {})