clean up created_at default test (#34)

This commit is contained in:
Ryan Armstrong
2023-01-21 09:14:06 -08:00
committed by GitHub
parent 572bcfe628
commit a0c89b33b8

View File

@@ -3,7 +3,12 @@ from nostr.key import PrivateKey
import time import time
def test_event_default_time(): def test_event_default_time():
time.sleep(1.5) """
ensure created_at default value reflects the time at Event object instantiation
see: https://github.com/jeffthibault/python-nostr/issues/23
"""
public_key = PrivateKey().public_key.hex() public_key = PrivateKey().public_key.hex()
event = Event(public_key=public_key, content='test event') event1 = Event(public_key=public_key, content='test event')
assert (event.created_at - time.time()) < 1 time.sleep(1.5)
event2 = Event(public_key=public_key, content='test event')
assert event1.created_at < event2.created_at