Ejemplo n.º 1
0
    def test_can_stop(self):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()

        otto.stop()

        expect(otto.ioloop.stop.called).to_be_true()
Ejemplo n.º 2
0
    def test_can_handle_wait_timeout(self):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()

        otto.handle_wait_timeout(1, None)

        expect(otto.ioloop.stop.called).to_be_true()
Ejemplo n.º 3
0
    def test_can_stop(self):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()

        otto.stop()

        expect(otto.ioloop.stop.called).to_be_true()
Ejemplo n.º 4
0
    def test_can_handle_wait_timeout(self):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()

        otto.handle_wait_timeout(1, None)

        expect(otto.ioloop.stop.called).to_be_true()
Ejemplo n.º 5
0
    def test_can_wait_when_urls_and_no_timeout(self, logging_mock):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()
        otto.running_urls = 10

        otto.wait(0)

        logging_mock.assert_calls('Waiting for urls to be retrieved.')
Ejemplo n.º 6
0
    def test_can_wait_when_urls_and_timeout(self):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()
        otto.running_urls = 10

        otto.wait()

        expect(otto.ioloop.set_blocking_signal_threshold.called)
Ejemplo n.º 7
0
    def test_can_wait_when_urls_and_no_timeout(self, logging_mock):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()
        otto.running_urls = 10

        otto.wait(0)

        logging_mock.assert_calls('Waiting for urls to be retrieved.')
Ejemplo n.º 8
0
    def test_can_wait_when_urls_and_timeout(self):
        otto = TornadoOctopus(cache=False, auto_start=True)
        otto.ioloop = Mock()
        otto.running_urls = 10

        otto.wait()

        expect(otto.ioloop.set_blocking_signal_threshold.called)