aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-02-08 19:51:54 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-02-08 19:51:54 +0100
commit1365e21ab9f13597d7fdb4feb0825453f32cae4b (patch)
tree87e1c7ce51ad9aac875dd3d0ff973ed735d88570 /test
parent7e0987bcda136a17baea45b8eb22eb5ea668abc0 (diff)
downloadbsfs-1365e21ab9f13597d7fdb4feb0825453f32cae4b.tar.gz
bsfs-1365e21ab9f13597d7fdb4feb0825453f32cae4b.tar.bz2
bsfs-1365e21ab9f13597d7fdb4feb0825453f32cae4b.zip
ucid from buffer and bytes
Diffstat (limited to 'test')
-rw-r--r--test/utils/test_uuid.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/utils/test_uuid.py b/test/utils/test_uuid.py
index 0de96ed..804b063 100644
--- a/test/utils/test_uuid.py
+++ b/test/utils/test_uuid.py
@@ -83,6 +83,16 @@ class TestUCID(unittest.TestCase):
def test_from_path(self):
self.assertEqual(UCID.from_path(self._path), self._checksum)
+ def test_from_buffer(self):
+ with open(self._path, 'rb') as ifile:
+ self.assertEqual(UCID.from_buffer(ifile), self._checksum)
+ with open(self._path) as ifile:
+ self.assertEqual(UCID.from_buffer(ifile), self._checksum)
+
+ def test_from_bytes(self):
+ with open(self._path, 'rb') as ifile:
+ self.assertEqual(UCID.from_bytes(ifile.read()), self._checksum)
+
def test_from_dict(self):
self.assertEqual(UCID.from_dict({'hello': 'world', 'foo': 1234, 'bar': False}),
'8d2544395a0d2827e3d9ce8cd619d5e3f801e8126bf3f93ee5abd38158959585')