diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c07b43e92..5917146aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/dash/dash.py b/dash/dash.py index b13ee0f050..21f5e710b7 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -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 @@ -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 @@ -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 diff --git a/dash/exceptions.py b/dash/exceptions.py index 5d90704a0e..13b4feb044 100644 --- a/dash/exceptions.py +++ b/dash/exceptions.py @@ -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 diff --git a/tests/test_react.py b/tests/test_react.py index e14c62e233..28cc3e9dfe 100644 --- a/tests/test_react.py +++ b/tests/test_react.py @@ -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')] @@ -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')] @@ -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')] @@ -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')] @@ -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')]