Beispiel #1
0
def test_dynamo_tracker_floats():
    conversation_id = uuid.uuid4().hex

    tracker_store = DynamoTrackerStore(domain)
    tracker = tracker_store.get_or_create_tracker(conversation_id,
                                                  append_action_listen=False)

    # save `slot` event with known `float`-type timestamp
    timestamp = 13423.23434623
    tracker.update(SlotSet("key", "val", timestamp=timestamp))
    tracker_store.save(tracker)

    # retrieve tracker and the event timestamp is retrieved as a `float`
    tracker = tracker_store.get_or_create_tracker(conversation_id)
    retrieved_timestamp = tracker.events[0].timestamp
    assert isinstance(retrieved_timestamp, float)
    assert retrieved_timestamp == timestamp
def test_dynamo_get_or_create():
    get_or_create_tracker_store(DynamoTrackerStore(domain))