-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
8e962bd
commit b9c8b41
Showing
9 changed files
with
97 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import pytest | ||
import punctilious as pu | ||
import uuid | ||
from test_shared_library import create_atomic_connector, create_function | ||
|
||
|
||
class TestSlug: | ||
def test_slug(self): | ||
"""Test of representation with multiple string-constant renderers. | ||
""" | ||
|
||
s1 = pu.Slug("foo") | ||
s2 = pu.Slug("bar") | ||
s3 = pu.Slug("foo") | ||
assert s1 != s2 | ||
assert s1 == s3 | ||
|
||
def test_identifier(self): | ||
uuid1 = uuid.uuid4() | ||
uuid2 = uuid.uuid4() | ||
foo = pu.Slug('foo') | ||
bar = pu.Slug('bar') | ||
taz = pu.Slug('taz') | ||
i1 = pu.Identifier(uuid1, foo, bar) | ||
i2 = pu.Identifier(uuid2, foo, bar) | ||
i3 = pu.Identifier(uuid1, foo, bar) | ||
i4 = pu.Identifier(uuid1, foo, taz) | ||
print(hash(i1)) | ||
print(hash(i4)) | ||
assert i1.package_slug == pu.Slug('foo') | ||
assert i1.package_uuid == uuid1 | ||
assert i1.slug == pu.Slug('bar') | ||
assert i4.slug == pu.Slug('taz') | ||
assert i1 != i2 | ||
assert i1 == i3 | ||
assert i1 != i4 |