Пример #1
0
    def test_spy_not_testing(self):
        "Trying to spy when not in testing mode"

        # Pretend the test ended
        bond_instance = bond.Bond.instance()
        old_test_framework_bridge = bond_instance.test_framework_bridge
        bond_instance.test_framework_bridge = None  # We reach into the internal API

        self.assertFalse(bond.active())
        bond.spy('first_observation', val=1)
        bond.spy('second_observation', val=2)

        # Just before the test ends, we restore current_python_test
        bond_instance.test_framework_bridge = old_test_framework_bridge  # Has to allow the test to continue
Пример #2
0
 def setUp(self):
     setup_bond_self_test(self, ())
     self.assertTrue(bond.active())
Пример #3
0
 def setUp(self):
     setup_bond_self_tests(self)
     self.assertTrue(bond.TESTING)
     self.assertTrue(bond.active())