summaryrefslogtreecommitdiff
path: root/test/test_timestamp.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2022-03-03 12:29:55 +0900
committerGitHub <noreply@github.com>2022-03-03 12:29:55 +0900
commitcb50b2081b21e5cb4a364d292f55092c98aa1a6f (patch)
treece97035a3f9c129ab52e665b21a7124cf55d5500 /test/test_timestamp.py
parent89ea57747ebcb0fad004a92ab00ebf13c10b2d51 (diff)
downloadmsgpack-python-cb50b2081b21e5cb4a364d292f55092c98aa1a6f.tar.gz
Update setuptools and black (#498)
* Use setuptools * Use black==22.1.0
Diffstat (limited to 'test/test_timestamp.py')
-rw-r--r--test/test_timestamp.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_timestamp.py b/test/test_timestamp.py
index 4e26489..253228e 100644
--- a/test/test_timestamp.py
+++ b/test/test_timestamp.py
@@ -10,31 +10,31 @@ if sys.version_info[0] > 2:
def test_timestamp():
# timestamp32
- ts = Timestamp(2 ** 32 - 1)
+ ts = Timestamp(2**32 - 1)
assert ts.to_bytes() == b"\xff\xff\xff\xff"
packed = msgpack.packb(ts)
assert packed == b"\xd6\xff" + ts.to_bytes()
unpacked = msgpack.unpackb(packed)
assert ts == unpacked
- assert ts.seconds == 2 ** 32 - 1 and ts.nanoseconds == 0
+ assert ts.seconds == 2**32 - 1 and ts.nanoseconds == 0
# timestamp64
- ts = Timestamp(2 ** 34 - 1, 999999999)
+ ts = Timestamp(2**34 - 1, 999999999)
assert ts.to_bytes() == b"\xee\x6b\x27\xff\xff\xff\xff\xff"
packed = msgpack.packb(ts)
assert packed == b"\xd7\xff" + ts.to_bytes()
unpacked = msgpack.unpackb(packed)
assert ts == unpacked
- assert ts.seconds == 2 ** 34 - 1 and ts.nanoseconds == 999999999
+ assert ts.seconds == 2**34 - 1 and ts.nanoseconds == 999999999
# timestamp96
- ts = Timestamp(2 ** 63 - 1, 999999999)
+ ts = Timestamp(2**63 - 1, 999999999)
assert ts.to_bytes() == b"\x3b\x9a\xc9\xff\x7f\xff\xff\xff\xff\xff\xff\xff"
packed = msgpack.packb(ts)
assert packed == b"\xc7\x0c\xff" + ts.to_bytes()
unpacked = msgpack.unpackb(packed)
assert ts == unpacked
- assert ts.seconds == 2 ** 63 - 1 and ts.nanoseconds == 999999999
+ assert ts.seconds == 2**63 - 1 and ts.nanoseconds == 999999999
# negative fractional
ts = Timestamp.from_unix(-2.3) # s: -3, ns: 700000000