Пример #1
0
 def setUp(self):
     """
     Remember the current state, then reset
     """
     self.was_patched = unpatch()
     self.unpatch_all()
     self.addCleanup(self.cleanup)
 def setUp(self):
     """
     Remember the current state, then reset
     """
     self.was_patched = unpatch()
     self.unpatch_all()
     self.addCleanup(self.cleanup)
 def setUp(self):
     """
     Remember the current state, then reset
     """
     super(MonkeyPatchTest, self).setUp()
     self.was_patched = unpatch()
     self.unpatch_all()
     self.addCleanup(self.cleanup)
Пример #4
0
 def setUp(self):
     """
     Remember the current state, then reset
     """
     super(MonkeyPatchTest, self).setUp()
     self.was_patched = unpatch()
     self.unpatch_all()
     self.addCleanup(self.cleanup)
 def test_patch(self):
     """
     Test that `self._` correctly translates text before, during, and
     after being monkey-patched.
     """
     self.assert_translations()
     was_successful = patch()
     self.assertTrue(was_successful)
     self.assert_translations()
     was_successful = unpatch()
     self.assertTrue(was_successful)
     self.assert_translations()
Пример #6
0
 def test_patch(self):
     """
     Test that `self._` correctly translates text before, during, and
     after being monkey-patched.
     """
     self.assert_translations()
     was_successful = patch()
     self.assertTrue(was_successful)
     self.assert_translations()
     was_successful = unpatch()
     self.assertTrue(was_successful)
     self.assert_translations()
 def unpatch_all(self):
     """
     Unpatch the module recursively
     """
     while is_patched():
         unpatch()
Пример #8
0
 def unpatch_all(self):
     """
     Unpatch the module recursively
     """
     while is_patched():
         unpatch()