def test_mpdrmq_agent_run_call_connect(self): agentconf={} mpdconf={"host":"mpd.lan"} rmqconf={"host":"rmq.lan"} agent=MpdRmqAgent(agentconf, mpdconf, rmqconf) mpdmock=Mock() agent.mpdclient=mpdmock rmqmock=Mock() agent.rmqclient=rmqmock # Mock the execute method to get rid of Not implemented exceptions execute=Mock() agent.execute=execute agent.run() mpdmock.connect.assert_called_with() mpdmock.connect.assert_called_with() rmqmock.disconnect.assert_called_with() rmqmock.disconnect.assert_called_with()