From 9b80236a0df6acfa0a035072dddc2c40d56d7f4c Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Mon, 24 Oct 2022 16:57:07 +0100 Subject: [PATCH] Add a test for binding tuples of the wrong size --- tests/test_binding.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_binding.py b/tests/test_binding.py index d2d61ac18..ccd00c007 100644 --- a/tests/test_binding.py +++ b/tests/test_binding.py @@ -1,6 +1,6 @@ import pytest -from textual.binding import Bindings, Binding +from textual.binding import Bindings, Binding, BindingError BINDING1 = Binding("a,b", action="action1", description="description1") BINDING2 = Binding("c", action="action2", description="description2") @@ -29,3 +29,9 @@ def test_bindings_merge_overlap(): "a": another_binding, "b": Binding("b", action="action1", description="description1"), } + +def test_bad_binding_tuple(): + with pytest.raises(BindingError): + _ = Bindings((("a", "action"),)) + with pytest.raises(BindingError): + _ = Bindings((("a", "action", "description","too much"),))