From eef399aa6c0e5968cc4f4661adcfaad3e55b9279 Mon Sep 17 00:00:00 2001 From: Jay Faulkner Date: Wed, 5 Mar 2014 15:37:57 -0800 Subject: [PATCH] fix(test): Properly mock hwmgr for heartbeat test --- teeth_agent/tests/agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/teeth_agent/tests/agent.py b/teeth_agent/tests/agent.py index d3e98a210..f1d4ed20c 100644 --- a/teeth_agent/tests/agent.py +++ b/teeth_agent/tests/agent.py @@ -26,7 +26,7 @@ from teeth_rest import encoding from teeth_agent import agent from teeth_agent import base from teeth_agent import errors - +from teeth_agent import hardware EXPECTED_ERROR = RuntimeError('command execution failed') @@ -48,6 +48,8 @@ class TestHeartbeater(unittest.TestCase): self.mock_agent = mock.Mock() self.heartbeater = agent.TeethAgentHeartbeater(self.mock_agent) self.heartbeater.api = mock.Mock() + self.heartbeater.hardware = mock.create_autospec( + hardware.HardwareManager) self.heartbeater.stop_event = mock.Mock() @mock.patch('time.time')