示例#1
0
 def test_patch_and_restore(self):
     cleanup = monkeypatch(
         'testrepository.tests.test_monkeypatch.reference', 45)
     self.assertEqual(45, reference)
     cleanup()
     self.assertEqual(23, reference)
示例#2
0
 def stub__find_command(self, cmd_run):
     self.calls = []
     self.addCleanup(monkeypatch('testrepository.commands._find_command',
         self._find_command))
     self.cmd_run = cmd_run
 def stub__find_command(self, cmd_run):
     self.calls = []
     self.addCleanup(
         monkeypatch('testrepository.commands._find_command',
                     self._find_command))
     self.cmd_run = cmd_run
 def test_patch_and_restore(self):
     cleanup = monkeypatch(
         'testrepository.tests.test_monkeypatch.reference', 45)
     self.assertEqual(45, reference)
     cleanup()
     self.assertEqual(23, reference)