def test_events(self):
        wait_time = 10  # seconds
        now = datetime.datetime.now()

        now_ts = int(time.mktime(now.timetuple()))
        now_title = 'end test title ' + str(now_ts)
        now_message = 'test message ' + str(now_ts)

        before_ts = int(time.mktime((now - datetime.timedelta(minutes=5)).timetuple()))
        before_title = 'start test title ' + str(before_ts)
        before_message = 'test message ' + str(before_ts)

        now_event_id = dog.event_with_response(now_title, now_message, now_ts)
        before_event_id = dog.event_with_response(before_title, before_message, before_ts)
        time.sleep(wait_time)

        now_event = dog.get_event(now_event_id)
        before_event = dog.get_event(before_event_id)

        self.assertEquals(now_event['text'], now_message)
        self.assertEquals(before_event['text'], before_message)

        event_id = dog.event_with_response('test host and device',
                                           'test host and device',
                                           host='test.host',
                                           device_name='test.device')
        time.sleep(wait_time)
        event = dog.get_event(event_id)

        self.assertEquals(event['host'], 'test.host')
        self.assertEquals(event['device_name'], 'test.device')

        event_id = dog.event_with_response('test event tags',
                                           'test event tags',
                                           tags=['test-tag-1', 'test-tag-2'])
        time.sleep(wait_time)
        event = dog.get_event(event_id)

        assert 'test-tag-1' in event['tags']
        assert 'test-tag-2' in event['tags']
dataset/ETHPy150Open DataDog/dogapi/tests/integration/test_dog_http_api.py/TestDatadog.test_events/original