diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:29 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:29 +0100 |
commit | 48b6081d0092e9c5a1b0ad79bdde2e51649bf61a (patch) | |
tree | 634198c34aae3c0306ce30ac7452abd7b53a14e8 /test/utils/test_uuid.py | |
parent | 91437ba89d35bf482f3d9671bb99ef2fc69f5985 (diff) | |
parent | e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a (diff) | |
download | bsfs-bf79057349a8fc842c660c0ed17599ceb5f285ca.tar.gz bsfs-bf79057349a8fc842c660c0ed17599ceb5f285ca.tar.bz2 bsfs-bf79057349a8fc842c660c0ed17599ceb5f285ca.zip |
Merge branch 'develop'v0.23.03
Diffstat (limited to 'test/utils/test_uuid.py')
-rw-r--r-- | test/utils/test_uuid.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/test/utils/test_uuid.py b/test/utils/test_uuid.py index 49176d4..8f519d9 100644 --- a/test/utils/test_uuid.py +++ b/test/utils/test_uuid.py @@ -1,9 +1,4 @@ -""" -Part of the tagit test suite. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports import os import re @@ -83,6 +78,20 @@ 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') + ## main ## |