-
Notifications
You must be signed in to change notification settings - Fork 58
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 #333 from bancorprotocol/331-trading-on-aerodrome_…
…v2-is-not-properly-supported 331 trading on aerodrome v2 is not properly supported
- Loading branch information
Showing
9 changed files
with
413 additions
and
122 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Happy path test with various realistic test values | ||
import pytest | ||
|
||
from fastlane_bot.events.exceptions import AyncUpdateRetryException | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"message, id", | ||
[ | ||
("Failed to update, retrying...", 'happy-1'), | ||
("Update failed at step 3, retrying...", 'happy-2'), | ||
("Temporary network issue, attempt retry...", 'happy-3'), | ||
], | ||
) | ||
def test_aync_update_retry_exception_with_message(message, id): | ||
# Act | ||
exception = AyncUpdateRetryException(message) | ||
|
||
# Assert | ||
assert str(exception) == message, f"Test case {id} failed: The exception message does not match the expected message." | ||
|
||
# Edge case test with empty string as message | ||
@pytest.mark.parametrize( | ||
"message, id", | ||
[ | ||
("", 'edge-1'), | ||
], | ||
) | ||
def test_aync_update_retry_exception_with_empty_message(message, id): | ||
# Act | ||
exception = AyncUpdateRetryException(message) | ||
|
||
# Assert | ||
assert str(exception) == message, f"Test case {id} failed: The exception message should be empty." | ||
|
||
# Happy path case test which raises exceptions (should raise AyncUpdateRetryException) | ||
@pytest.mark.parametrize( | ||
"message, id", | ||
[ | ||
('happy-1', 'happy-1'), | ||
(None, 'happy-2'), | ||
('3', 'happy-3'), | ||
], | ||
) | ||
def test_aync_update_retry_exception_raises(message, id): | ||
# Act & Assert | ||
with pytest.raises(AyncUpdateRetryException, match=message): | ||
raise AyncUpdateRetryException(message) |
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
Oops, something went wrong.