-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import pytest | ||
|
||
|
||
def test_uuid1(): | ||
from uuid import UUID | ||
|
||
from jobflow.utils.uuid import get_timestamp_from_uuid, suuid | ||
|
||
uuid = suuid("uuid1") | ||
assert UUID(uuid).version == 1 | ||
|
||
assert isinstance(get_timestamp_from_uuid(uuid), float) | ||
|
||
with pytest.raises(ValueError, match="UUID type uuid2 not supported."): | ||
suuid("uuid2") | ||
|
||
with pytest.raises(ValueError, match="ID type for FAKEUUID not recognized."): | ||
get_timestamp_from_uuid("FAKEUUID") |