コード例 #1
0
ファイル: bond_test.py プロジェクト: menge101/bond
    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
ファイル: bond_test.py プロジェクト: menge101/bond
 def setUp(self):
     setup_bond_self_test(self, ())
     self.assertTrue(bond.active())
コード例 #3
0
ファイル: bond_test.py プロジェクト: junecong/bond
 def setUp(self):
     setup_bond_self_tests(self)
     self.assertTrue(bond.TESTING)
     self.assertTrue(bond.active())