Skip to content

Commit

Permalink
Merge pull request #522 from plotly/existentialism
Browse files Browse the repository at this point in the history
typo in exception names
  • Loading branch information
alexcjohnson authored Jan 7, 2019
2 parents 2c182b1 + 18f5c41 commit aac493c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased - 2019-01-07
## Fixed
- Fix typo in some exception names [#522](https://github.com/plotly/dash/pull/522)

## 0.35.1 - 2018-12-27
### Fixed
- Always skip `dynamic` resources from index resources collection. [#518](https://github.com/plotly/dash/pull/518)
Expand Down
6 changes: 3 additions & 3 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ def _validate_callback(self, output, inputs, state, events):
'supress_callback_exceptions') and
arg.component_id not in layout and
arg.component_id != getattr(layout, 'id', None)):
raise exceptions.NonExistantIdException('''
raise exceptions.NonExistentIdException('''
Attempting to assign a callback to the
component with the id "{}" but no
components with id "{}" exist in the
Expand Down Expand Up @@ -698,7 +698,7 @@ def _validate_callback(self, output, inputs, state, events):
component.available_properties and not
any(arg.component_property.startswith(w) for w in
component.available_wildcard_properties)):
raise exceptions.NonExistantPropException('''
raise exceptions.NonExistentPropException('''
Attempting to assign a callback with
the property "{}" but the component
"{}" doesn't have "{}" as a property.\n
Expand All @@ -715,7 +715,7 @@ def _validate_callback(self, output, inputs, state, events):
if (hasattr(arg, 'component_event') and
arg.component_event not in
component.available_events):
raise exceptions.NonExistantEventException('''
raise exceptions.NonExistentEventException('''
Attempting to assign a callback with
the event "{}" but the component
"{}" doesn't have "{}" as an event.\n
Expand Down
6 changes: 3 additions & 3 deletions dash/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class CallbackException(DashException):
pass


class NonExistantIdException(CallbackException):
class NonExistentIdException(CallbackException):
pass


class NonExistantPropException(CallbackException):
class NonExistentPropException(CallbackException):
pass


class NonExistantEventException(CallbackException):
class NonExistentEventException(CallbackException):
pass


Expand Down
14 changes: 7 additions & 7 deletions tests/test_react.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def test_exception_id_not_in_layout(self):
app = dash.Dash('')
app.layout = Div('', id='test')
self.assertRaises(
exceptions.NonExistantIdException,
exceptions.NonExistentIdException,
app.callback,
Output('output', 'children'),
[Input('input', 'value')]
Expand All @@ -395,21 +395,21 @@ def test_exception_prop_not_in_component(self):
], id='body')

self.assertRaises(
exceptions.NonExistantPropException,
exceptions.NonExistentPropException,
app.callback,
Output('output', 'non-there'),
[Input('input', 'value')]
)

self.assertRaises(
exceptions.NonExistantPropException,
exceptions.NonExistentPropException,
app.callback,
Output('output', 'children'),
[Input('input', 'valuez')]
)

self.assertRaises(
exceptions.NonExistantPropException,
exceptions.NonExistentPropException,
app.callback,
Output('body', 'childrenz'),
[Input('input', 'value')]
Expand All @@ -426,7 +426,7 @@ def test_exception_event_not_in_component(self):

for id in ['output', 'body']:
self.assertRaises(
exceptions.NonExistantEventException,
exceptions.NonExistentEventException,
app.callback,
Output(id, 'children'),
events=[Event(id, 'style')]
Expand All @@ -437,7 +437,7 @@ def test_exception_event_not_in_component(self):
)

self.assertRaises(
exceptions.NonExistantEventException,
exceptions.NonExistentEventException,
app.callback,
Output('output', 'children'),
events=[Event('graph', 'zoom')]
Expand Down Expand Up @@ -474,7 +474,7 @@ def test_suppress_callback_exception(self):
Div(id='output')
], id='body')
self.assertRaises(
exceptions.NonExistantIdException,
exceptions.NonExistentIdException,
app.callback,
Output('id-not-there', 'children'),
[Input('input', 'value')]
Expand Down

0 comments on commit aac493c

Please sign in to comment.