mirror of
https://github.com/aljazceru/python-nostr.git
synced 2025-12-19 07:14:23 +01:00
clean up created_at default test (#34)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user