def test_comments(self):
        wait_time = 3  # seconds
        now = datetime.datetime.now()
        now_ts = int(time.mktime(now.timetuple()))
        before_ts = int(time.mktime((now - datetime.timedelta(minutes=15)).timetuple()))
        message = 'test message ' + str(now_ts)

        comment_id = dog.comment(TEST_USER, message)
        time.sleep(wait_time)
        event = dog.get_event(comment_id)
        eq(event['text'], message)

        dog.update_comment(TEST_USER, message + ' updated', comment_id)
        time.sleep(wait_time)
        event = dog.get_event(comment_id)
        eq(event['text'], message + ' updated')

        reply_id = dog.comment(TEST_USER, message + ' reply', related_event_id=comment_id)
        time.sleep(wait_time)
        stream = dog.stream(before_ts, now_ts+100)

        ok(stream is not None, msg="No events found in stream")
        ok(isinstance(stream, list), msg="Event stream is not a list")
        ok(len(stream) > 0, msg="No events found in stream")

        comment_ids = [x['id'] for x in stream[0]['comments']]
        ok(reply_id in comment_ids,
           msg="Should find {0} in {1}".format(reply_id, comment_ids))

        # Delete the reply
        dog.delete_comment(reply_id)
        # Then the post itself
        dog.delete_comment(comment_id)
        time.sleep(wait_time)
        try:
            dog.get_event(comment_id)
        except:
            pass
        else:
            assert False
dataset/ETHPy150Open DataDog/dogapi/tests/integration/test_dog_http_api.py/TestDatadog.test_comments/original