Пример #1
0
 def test_xbmcrmq_agent_xbmcclient(self):
   """ Test that the xbmcclient accessor returns the xbmc.client instance """
   agentconf={}
   xbmcconf={"host":"xbmc.lan"}
   rmqconf={"host":"rmq.lan"}
   agent=XbmcRmqAgent(agentconf, xbmcconf, rmqconf)
   self.assertTrue(agent.xbmc.client == agent.xbmcclient())
Пример #2
0
  def test_xbmcrmq_before_execute(self, mocked):
    """ Test that the call to before_execute call superclass before_execute"""
    agentconf={}
    xbmcconf={"host":"xbmc.lan"}
    rmqconf={"host":"rmq.lan"}
    agent=XbmcRmqAgent(agentconf, xbmcconf, rmqconf)

    #Setup generic mock for others methos wich are not tested here
    ignoredmocks=Mock()
    agent.xbmc=ignoredmocks
    agent.rmqclient=ignoredmocks
    

    instance = mocked.return_value 
    agent.before_execute()
    mocked.assert_called_with(agent)