Пример #1
0
    def test_get_jamchart(self):
        api = PhishNetAPI()
        jamchart_response = api.get_jamchart(7)

        assert jamchart_response['error_code'] == 0
        assert jamchart_response['response']['data']['songid'] == 7
        assert jamchart_response['response']['count'] == len(
            jamchart_response['response']['data'])
Пример #2
0
    def test_get_jamchart(self, requests_mock):
        api = PhishNetAPI('apikey123456789test1')
        with open('tests/data/get_jamchart.json') as f:
            get_jamchart_json = json.load(f)
        requests_mock.post(api.base_url + "jamcharts/get",
                           json=get_jamchart_json)

        jamchart_response = api.get_jamchart(7)
        assert jamchart_response['response']['data']['songid'] == 7
        assert len(jamchart_response['response']['data']['entries']) == 7