-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from attevaltojarvi/main
Improvements and fixes
- Loading branch information
Showing
3 changed files
with
33 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import pytest | ||
from uuid6 import UUID | ||
|
||
from typeid import from_string, from_uuid | ||
from typeid import TypeID | ||
|
||
|
||
def test_invalid_spec(invalid_spec: list) -> None: | ||
for spec in invalid_spec: | ||
with pytest.raises(Exception): | ||
from_string(spec["typeid"]) | ||
TypeID.from_string(spec["typeid"]) | ||
|
||
|
||
def test_valid_spec(valid_spec: list) -> None: | ||
for spec in valid_spec: | ||
prefix = spec["prefix"] | ||
uuid = UUID(spec["uuid"]) | ||
|
||
typeid = from_uuid(prefix=prefix, suffix=uuid) | ||
typeid = TypeID.from_uuid(prefix=prefix, suffix=uuid) | ||
assert str(typeid) == spec["typeid"] |
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