-
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.
🔨 refactor: reorganize mother classes into date and identifier module…
…s, update naming conventions
- Loading branch information
1 parent
675450a
commit b125b36
Showing
25 changed files
with
153 additions
and
144 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
15 changes: 0 additions & 15 deletions
15
object_mother_pattern/mothers/additional_types/__init__.py
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from .date import DateMother, StringDateMother | ||
from .datetime import DatetimeMother, StringDatetimeMother | ||
|
||
__all__ = ( | ||
'DateMother', | ||
'DatetimeMother', | ||
'StringDateMother', | ||
'StringDatetimeMother', | ||
) |
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,7 @@ | ||
from .date_mother import DateMother | ||
from .string_date_mother import StringDateMother | ||
|
||
__all__ = ( | ||
'DateMother', | ||
'StringDateMother', | ||
) |
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
from .datetime_mother import DatetimeMother | ||
from .string_datetime_mother import StringDatetimeMother | ||
|
||
__all__ = ( | ||
'DatetimeMother', | ||
'StringDatetimeMother', | ||
) |
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
from .string_uuid_mother import StringUuidMother | ||
from .uuid_mother import UuidMother | ||
|
||
__all__ = ( | ||
'StringUuidMother', | ||
'UuidMother', | ||
) |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
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,56 @@ | ||
""" | ||
Test module for the StringUuidMother class. | ||
""" | ||
|
||
from uuid import UUID | ||
|
||
from pytest import raises as assert_raises | ||
|
||
from object_mother_pattern.mothers import StringUuidMother | ||
|
||
|
||
def test_string_uuid_mother_happy_path() -> None: | ||
""" | ||
Test StringUuidMother happy path. | ||
""" | ||
value = StringUuidMother.create() | ||
|
||
assert type(value) is str | ||
UUID(value) | ||
|
||
|
||
def test_string_uuid_mother_value() -> None: | ||
""" | ||
Test StringUuidMother create method with value. | ||
""" | ||
value = StringUuidMother.create() | ||
|
||
assert StringUuidMother.create(value=value) == value | ||
|
||
|
||
def test_string_uuid_mother_invalid_type() -> None: | ||
""" | ||
Test StringUuidMother create method with invalid type. | ||
""" | ||
assert type(StringUuidMother.invalid_type()) is not str | ||
|
||
|
||
def test_string_uuid_mother_invalid_value() -> None: | ||
""" | ||
Test StringUuidMother invalid_value method. | ||
""" | ||
value = StringUuidMother.invalid_value() | ||
|
||
assert type(value) is str | ||
assert not value.isprintable() | ||
|
||
|
||
def test_string_uuid_mother_invalid_value_type() -> None: | ||
""" | ||
Test StringUuidMother create method with invalid value type. | ||
""" | ||
with assert_raises( | ||
expected_exception=TypeError, | ||
match='StringUuidMother value must be a string.', | ||
): | ||
StringUuidMother.create(value=StringUuidMother.invalid_type()) |
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,45 @@ | ||
""" | ||
Test module for the UuidMother class. | ||
""" | ||
|
||
from uuid import UUID | ||
|
||
from pytest import raises as assert_raises | ||
|
||
from object_mother_pattern.mothers import UuidMother | ||
|
||
|
||
def test_uuid_mother_happy_path() -> None: | ||
""" | ||
Test UuidMother happy path. | ||
""" | ||
value = UuidMother.create() | ||
|
||
assert type(value) is UUID | ||
|
||
|
||
def test_uuid_mother_value() -> None: | ||
""" | ||
Test UuidMother create method with value. | ||
""" | ||
value = UuidMother.create() | ||
|
||
assert UuidMother.create(value=value) == value | ||
|
||
|
||
def test_uuid_mother_invalid_type() -> None: | ||
""" | ||
Test UuidMother create method with invalid type. | ||
""" | ||
assert type(UuidMother.invalid_type()) is not UUID | ||
|
||
|
||
def test_uuid_mother_invalid_value_type() -> None: | ||
""" | ||
Test UuidMother create method with invalid value type. | ||
""" | ||
with assert_raises( | ||
expected_exception=TypeError, | ||
match='UuidMother value must be a UUID.', | ||
): | ||
UuidMother.create(value=UuidMother.invalid_type()) |