Ejemplo n.º 1
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))
Ejemplo n.º 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))
Ejemplo n.º 3
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))
Ejemplo n.º 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))