def test_events_all(self):
        responses.add(responses.GET, 'https://api.cronofy.com/v1/events',
                      body=json.dumps(DUMMY_EVENTS_PAGE_1), status=200,
                      content_type='application/json')

        events = Event.all(access_token="DUMMY")

        self.assertEqual(2, len(events))
Beispiel #2
0
    def test_events_all(self):
        responses.add(responses.GET,
                      'https://api.cronofy.com/v1/events',
                      body=json.dumps(DUMMY_EVENTS_PAGE_1),
                      status=200,
                      content_type='application/json')

        events = Event.all(access_token="DUMMY")

        self.assertEqual(2, len(events))
    def test_events_all_pages(self):
        responses.add(responses.GET, 'https://api.cronofy.com/v1/events',
                      body=json.dumps(DUMMY_EVENTS_PAGE_1), status=200,
                      content_type='application/json')
        responses.add(responses.GET, 'https://api.cronofy.com/v1/events/pages/08a07b034306679e',
              body=json.dumps(DUMMY_EVENTS_PAGE_2), status=200,
              content_type='application/json')

        events = Event.all(access_token="DUMMY").get_all_pages()

        print events

        self.assertEqual(4, len(events))
Beispiel #4
0
    def test_events_all_pages(self):
        responses.add(responses.GET,
                      'https://api.cronofy.com/v1/events',
                      body=json.dumps(DUMMY_EVENTS_PAGE_1),
                      status=200,
                      content_type='application/json')
        responses.add(
            responses.GET,
            'https://api.cronofy.com/v1/events/pages/08a07b034306679e',
            body=json.dumps(DUMMY_EVENTS_PAGE_2),
            status=200,
            content_type='application/json')

        events = Event.all(access_token="DUMMY").get_all_pages()

        print events

        self.assertEqual(4, len(events))