Example #1
0
    def test_get_latest_setlist(self):
        api = PhishNetAPI()
        latest_setlist_response = api.get_latest_setlist()

        assert latest_setlist_response['error_code'] == 0
        assert latest_setlist_response['response']['count'] == len(
            latest_setlist_response['response']['data'])
Example #2
0
    def test_get_latest_setlist(self, requests_mock):
        api = PhishNetAPI('apikey123456789test1')
        with open('tests/data/latest_setlist.json') as f:
            latest_setlist_json = json.load(f)
        requests_mock.post(api.base_url + "setlists/latest",
                           json=latest_setlist_json)

        latest_setlists_response = api.get_latest_setlist()
        assert latest_setlists_response['response']['count'] == 1
        assert len(latest_setlists_response['response']['data']) == 1
        assert latest_setlists_response['response']['data'][0][
            'showid'] == 1252698446