Пример #1
0
    def test_get_collection(self):
        api = PhishNetAPI()
        collection_response = api.get_collection(1294148902)

        assert collection_response['error_code'] == 0
        assert collection_response['response']['data']['show_count'] == len(
            collection_response['response']['data']['shows'])
Пример #2
0
    def test_get_collection(self, requests_mock):
        api = PhishNetAPI('apikey123456789test1')
        with open('tests/data/get_collection.json') as f:
            get_collection_json = json.load(f)
        requests_mock.post(api.base_url + "collections/get",
                           json=get_collection_json)

        collection_response = api.get_collection(1294148902)
        assert collection_response['response']['data']['show_count'] == 7
        assert len(collection_response['response']['data']['shows']) == 7