コード例 #1
0
    def test_query_reviews(self):
        api = PhishNetAPI()
        reviews_response = api.query_reviews(showid=1394573037)

        assert reviews_response['error_code'] == 0
        assert reviews_response['response']['count'] == len(
            reviews_response['response']['data'])
コード例 #2
0
    def test_query_reviews(self, requests_mock):
        api = PhishNetAPI('apikey123456789test1')
        with open('tests/data/query_reviews.json') as f:
            query_reviews_json = json.load(f)
        requests_mock.post(api.base_url + "reviews/query",
                           json=query_reviews_json)

        reviews_response = api.query_reviews(uid=1, showid=1394573037)
        assert reviews_response['response']['count'] == 1
        assert len(reviews_response['response']['data']) == 1
        assert reviews_response['response']['data'][0][
            'reviewid'] == 1375467602