Ejemplo n.º 1
0
    def test_get_recent_setlists(self):
        api = PhishNetAPI()
        recent_setlists_response = api.get_recent_setlists()

        assert recent_setlists_response['error_code'] == 0
        assert recent_setlists_response['response']['count'] == 10
        assert len(recent_setlists_response['response']['data']) == 10
Ejemplo n.º 2
0
    def test_get_recent_setlists(self, requests_mock):
        api = PhishNetAPI('apikey123456789test1')
        with open('tests/data/recent_setlists.json') as f:
            get_recent_setlists_json = json.load(f)
        requests_mock.post(api.base_url + "setlists/recent",
                           json=get_recent_setlists_json)

        recent_setlists_response = api.get_recent_setlists()
        assert recent_setlists_response['response']['count'] == 10
        assert len(recent_setlists_response['response']['data']) == 10
        assert recent_setlists_response['response']['data'][0][
            'showid'] == 1470183033