Exemplo n.º 1
0
 def test_python__get_state_info(self):
     "_get_state_info() should return something sane."
     state_info = sleeper_agent._get_state_info()
     self.assertIn("test_python__get_state_info", state_info)
     self.assertIn('test.py", line 17', state_info)
     self.assertNotIn("test_c_sleeper_agent_state", state_info)
     self.assertNotIn('test.py", line 25', state_info)
Exemplo n.º 2
0
 def test_python_and_c_functions_return_same_string(self):
     "_get_state_info() and sleeper_agent_state() should return the same value."
     # WARNING: the two function calls should be on the same line,
     #          otherwise they won't match.
     py_bt, c_bt = \
            sleeper_agent._get_state_info(), sleeper_agent._sleeper_agent_activation.sleeper_agent_state()
     self.assertEqual(py_bt, c_bt)
Exemplo n.º 3
0
 def test_python_and_c_functions_return_same_string(self):
     "_get_state_info() and sleeper_agent_state() should return the same value."
     # WARNING: the two function calls should be on the same line,
     #          otherwise they won't match.
     # WARNING: the memory report cannot pass this test, as more objects
     #          are created during the C call, changing the report details
     py_bt, c_bt = \
            sleeper_agent._get_state_info(), sleeper_agent._sleeper_agent_activation.sleeper_agent_state()
     self.assertEqual(py_bt, c_bt)