-
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.
Merge pull request #5 from kilobyteno/release-0.1.1
- Loading branch information
Showing
8 changed files
with
98 additions
and
26 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,5 +1,5 @@ | ||
ENV=staging | ||
OPPE_ENV=staging | ||
|
||
TEST_API_TOKEN= | ||
TEST_PROJECT_ID= | ||
TEST_CHANNEL_ID= | ||
OPPE_TEST_API_TOKEN= | ||
OPPE_TEST_PROJECT_ID= | ||
OPPE_TEST_CHANNEL_ID= |
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 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 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 |
---|---|---|
|
@@ -10,3 +10,4 @@ Faker~=19.6.1 | |
pytest~=7.4.0 | ||
pytest-cov~=4.1.0 | ||
pytest-sugar~=0.9.7 | ||
pytest-mock~=3.11.1 |
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,42 @@ | ||
from oppe.exceptions import EventRequestError, OppeError, UuidValidationError | ||
|
||
|
||
def test_default_parameters(): | ||
""" Test default parameters """ | ||
error = OppeError() | ||
assert error.msg == 'Unknown error occurred' | ||
assert error.data is None | ||
|
||
|
||
def test_custom_parameters(): | ||
""" Test custom parameters """ | ||
error = OppeError(msg='Custom error message', data={'key': 'value'}) | ||
assert error.msg == 'Custom error message' | ||
assert error.data == {'key': 'value'} | ||
|
||
|
||
def test_empty_string_message(): | ||
""" Test empty string message """ | ||
error = OppeError('') | ||
assert error.msg == '' | ||
assert error.data is None | ||
|
||
|
||
def test_with_only_msg_attribute(): | ||
""" Test with only msg attribute """ | ||
error = OppeError('Error message') | ||
assert str(error) == 'Error message' | ||
|
||
|
||
def test_subclass_uuid_validation_error(): | ||
""" Test subclass UuidValidationError """ | ||
error = UuidValidationError(msg='Uuid Validation Error') | ||
assert error.msg == 'Uuid Validation Error' | ||
assert error.data is None | ||
|
||
|
||
def test_subclass_event_request_error(): | ||
""" Test subclass EventRequestError """ | ||
error = EventRequestError(msg='Event Request Error') | ||
assert error.msg == 'Event Request Error' | ||
assert error.data is None |
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