Esempio n. 1
0
    def test_get_all_people(self):
        api = PhishNetAPI()
        people_response = api.get_all_people()

        assert people_response['error_code'] == 0
        assert people_response['response']['count'] == len(
            people_response['response']['data'])
Esempio n. 2
0
    def test_get_all_people(self, requests_mock):
        api = PhishNetAPI('apikey123456789test1')
        with open('tests/data/all_people.json') as f:
            all_people_json = json.load(f)
        requests_mock.post(api.base_url + "people/all", json=all_people_json)

        people_response = api.get_all_people()
        assert people_response['response']['count'] == 12
        assert len(people_response['response']['data']) == 12
        assert people_response['response']['data'][0]['personid'] == 5710