Page MenuHomeSoftware Heritage
Paste P612

(An Untitled Masterwork)
ActivePublic

Authored by douardda on Mar 12 2020, 10:52 AM.
def test_timestamp_seconds():
attr.validate(Timestamp(seconds=0, microseconds=0))
with pytest.raises(AttributeTypeError):
attr.validate(Timestamp(seconds='0', microseconds=0))
attr.validate(Timestamp(seconds=2**63-1, microseconds=0))
with pytest.raises(ValueError):
attr.validate(Timestamp(seconds=2**63, microseconds=0))
attr.validate(Timestamp(seconds=-2**63, microseconds=0))
with pytest.raises(ValueError):
attr.validate(Timestamp(seconds=-2**63-1, microseconds=0))