Пример #1
0
 def test_cancel(self):
     # Test
     task_id = '123'
     agent = DirectAgent(CONSUMER)
     agent.cancel(task_id)
     # Verify
     criteria = {'eq': task_id}
     mock_agent.Admin.cancel.assert_called_once_with(criteria=criteria)
Пример #2
0
 def test_update_content(self):
     # Test
     agent = DirectAgent(CONSUMER)
     result = agent.content.update(UNITS, OPTIONS)
     # Verify
     mock_agent.Content.update.assert_called_once_with(UNITS, OPTIONS)
Пример #3
0
 def test_unbind(self):
     # Test
     agent = DirectAgent(CONSUMER)
     result = agent.consumer.unbind(BINDINGS, OPTIONS)
     # Verify
     mock_agent.Consumer.unbind.assert_called_once_with(BINDINGS, OPTIONS)
Пример #4
0
 def test_unregistered(self):
     # Test
     agent = DirectAgent(CONSUMER)
     agent.consumer.unregistered()
     # Verify
     mock_agent.Consumer.unregistered.assert_called_once_with()
Пример #5
0
 def test_profile_send(self):
     # Test
     agent = DirectAgent(CONSUMER)
     print agent.profile.send()
     # Verify
     mock_agent.Profile.send.assert_called_once_with()