def test_timestamp_range(self):
        all_events = self.client.events.list(_sort='@timestamp')
        first_event = all_events[0]
        median_event = all_events[len(all_events) / 2 - 1]
        min_time = first_event['@timestamp']
        max_time = median_event['@timestamp']
        # get only half of the events by timestamp
        ranged_events = \
            self.client.events.list(from_datetime=min_time,
                                    to_datetime=max_time)
        self.assertEquals(len(ranged_events), len(all_events) / 2)
dataset/ETHPy150Open cloudify-cosmo/cloudify-manager/tests/workflow_tests/test_events.py/EventsTest.test_timestamp_range/original