示例#1
0
    def test_handle_listener(self, Listener, ListenerManager, Backend):
        backend = object()
        Backend.objects.get.return_value = backend

        command = Command()
        command.handle(BACKEND='foo')

        ListenerManager.assert_not_called()
        Listener.assert_called_with(backend)
        Listener.return_value.run.assert_called()
示例#2
0
    def test_handle_listener(self, Listener, ListenerManager, Backend):
        backend = object()
        Backend.objects.get.return_value = backend

        command = Command()
        command.handle(BACKEND='foo')

        ListenerManager.assert_not_called()
        Listener.assert_called_with(backend)
        Listener.return_value.run.assert_called()
示例#3
0
    def test_handle(self, ListenerManager):
        command = Command()
        command.handle()

        ListenerManager.assert_called_once()
        ListenerManager.return_value.run.assert_called_once()
示例#4
0
    def test_handle(self, ListenerManager):
        command = Command()
        command.handle()

        ListenerManager.assert_called_once()
        ListenerManager.return_value.run.assert_called_once()