-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:jamesridgway/devdeck_core into main
- Loading branch information
Showing
1 changed file
with
7 additions
and
3 deletions.
There are no files selected for viewing
10 changes: 7 additions & 3 deletions
10
tests/devdeck/core/settings/test_control_validation_error.py
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,12 +1,16 @@ | ||
from assertpy import assert_that | ||
|
||
from devdeck.controls.timer_control import TimerControl | ||
from devdeck.core.settings.control_validation_error import ControlValidationError | ||
|
||
|
||
class TestControlValidationError: | ||
def test_errors_parsed(self): | ||
errors = {'decks': [{0: [{'controls': [{3: [{'keyx': ['unknown field']}]}]}]}]} | ||
exception = ControlValidationError(TimerControl(4, **{}), 4, errors) | ||
exception = ControlValidationError(SomeControl(), 4, errors) | ||
assert_that(str(exception)) \ | ||
.is_equal_to('The following validation errors occurred for TimerControl on key 4:\n * decks.0.controls.3.keyx: unknown field.') | ||
.is_equal_to( | ||
'The following validation errors occurred for SomeControl on key 4:\n * decks.0.controls.3.keyx: unknown field.') | ||
|
||
|
||
class SomeControl: | ||
pass |