Skip to content

Commit

Permalink
Merge branch 'main' of github.com:jamesridgway/devdeck_core into main
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesridgway committed Dec 23, 2020
2 parents 8492fbd + 9b78cfd commit 44a23d9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/devdeck/core/settings/test_control_validation_error.py
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

0 comments on commit 44a23d9

Please sign in to comment.