Exemple #1
0
    def test_get_all_jamcharts(self):
        api = PhishNetAPI()
        jamcharts_response = api.get_all_jamcharts()

        assert jamcharts_response['error_code'] == 0
        assert jamcharts_response['response']['count'] == len(
            jamcharts_response['response']['data'])
Exemple #2
0
    def test_get_all_jamcharts(self, requests_mock):
        api = PhishNetAPI('apikey123456789test1')
        with open('tests/data/all_jamcharts.json') as f:
            all_jamcharts_json = json.load(f)
        requests_mock.post(api.base_url + "jamcharts/all",
                           json=all_jamcharts_json)

        jamcharts_response = api.get_all_jamcharts()
        assert jamcharts_response['response']['count'] == 5
        assert len(jamcharts_response['response']['data']) == 5
        assert jamcharts_response['response']['data'][0]['songid'] == '2'