예제 #1
0
    def test_run(self, fake_feed):
        # test
        queue = RequestQueue(Mock(), Mock())
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
예제 #2
0
    def test_run(self, fake_feed):
        # test
        queue = RequestQueue(Mock())
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
예제 #3
0
    def test_run_with_exception(self, fake_feed, fake_drain):
        # test
        queue = RequestQueue(Mock(), Mock())
        queue.downloader.download.side_effect = ValueError()
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
        fake_drain.assert_called_with()
예제 #4
0
    def test_run_with_exception(self, fake_feed, fake_drain):
        # test
        queue = RequestQueue(Mock())
        queue.downloader.download.side_effect = ValueError()
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
        fake_drain.assert_called_with()
예제 #5
0
    def test_run(self, fake_feed):
        canceled = Mock()
        canceled.is_set.return_value = False

        # test
        queue = RequestQueue(canceled, Mock())
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
예제 #6
0
    def test_run(self, fake_feed):
        canceled = Mock()
        canceled.is_set.return_value = False

        # test
        queue = RequestQueue(canceled, Mock())
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
예제 #7
0
    def test_run_with_exception(self, fake_feed, fake_drain):
        canceled = Mock()
        canceled.is_set.return_value = False

        # test
        queue = RequestQueue(canceled, Mock())
        queue.downloader.download.side_effect = ValueError()
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
        fake_drain.assert_called_with()
예제 #8
0
    def test_run_with_exception(self, fake_feed, fake_drain):
        canceled = Mock()
        canceled.is_set.return_value = False

        # test
        queue = RequestQueue(canceled, Mock())
        queue.downloader.download.side_effect = ValueError()
        queue.run()

        # validation
        queue.downloader.download.assert_called_with(fake_feed())
        fake_drain.assert_called_with()