Пример #1
0
    def test_must_request__next_page_concurrently(self, mocker):
        self._mock_parse_response(mocker)
        self._mock_split_subreddit_names(mocker)
        self._mock_request_concurrent(mocker)
        self._mock_filter_by_upvotes(mocker)

        _request_concurrent_next_page = \
            self._mock_request_concurrent_next_pages(mocker)

        utils.get_reddits(self.subreddit_names)

        assert _request_concurrent_next_page.called is True
Пример #2
0
    def test_must_parse_response(self, mocker):
        self._mock_request_concurrent(mocker)
        self._mock_split_subreddit_names(mocker)
        self._mock_request_concurrent_next_pages(mocker)
        self._mock_filter_by_upvotes(mocker)

        _parse_response = self._mock_parse_response(mocker)

        utils.get_reddits(self.subreddit_names)

        assert _parse_response.called is True
        assert mocker.call(self.fake_response) in \
            _parse_response.call_args_list
Пример #3
0
    def test_must_return_expected_value(self, mocker):
        self._mock_parse_response(mocker)
        self._mock_request_concurrent(mocker)
        self._mock_request_concurrent_next_pages(mocker)
        self._mock_split_subreddit_names(mocker)
        self._mock_unpack(mocker)
        self._mock_filter_by_upvotes(mocker)

        assert utils.get_reddits(self.subreddit_names) == \
            self.expected_value