diff --git a/tests/test_sqlite.py b/tests/test_sqlite.py index a8b99d9acec83afd93c959f559b5bd30b0e00547..546b600df0da311f33aa64c0e6b986f6ad5dc39c 100644 --- a/tests/test_sqlite.py +++ b/tests/test_sqlite.py @@ -15,16 +15,21 @@ from cbutil.util import time_conversion def test_select(): assert select_stmt().strip() == "SELECT *" assert select_stmt("test").strip() == "SELECT test" - with pytest.raises(ValueError): - select_stmt("") - with pytest.raises(ValueError): - select_stmt(" ") -def test_from(): - assert from_stmt("table").strip() == "FROM table" +@pytest.mark.parametrize("select", ["", " "]) +def test_invalid_select(select): with pytest.raises(ValueError): - from_stmt("") + select_stmt(select) + + +@pytest.mark.parametrize("from_", ["table", " table ", "table "]) +def test_from_strip(from_): + assert from_stmt(from_).strip() == "FROM table" + + +@pytest.mark.parametrize("from_", ["", " "]) +def test_invalid_from(from_): with pytest.raises(ValueError): from_stmt(" ")