Skip to content
Snippets Groups Projects
Commit e183f604 authored by Christoph Alt's avatar Christoph Alt
Browse files

rework of select tests

parent 030a6565
No related merge requests found
Pipeline #45302 passed with stages
in 18 seconds
...@@ -15,16 +15,21 @@ from cbutil.util import time_conversion ...@@ -15,16 +15,21 @@ from cbutil.util import time_conversion
def test_select(): def test_select():
assert select_stmt().strip() == "SELECT *" assert select_stmt().strip() == "SELECT *"
assert select_stmt("test").strip() == "SELECT test" assert select_stmt("test").strip() == "SELECT test"
with pytest.raises(ValueError):
select_stmt("")
with pytest.raises(ValueError):
select_stmt(" ")
def test_from(): @pytest.mark.parametrize("select", ["", " "])
assert from_stmt("table").strip() == "FROM table" def test_invalid_select(select):
with pytest.raises(ValueError): 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): with pytest.raises(ValueError):
from_stmt(" ") from_stmt(" ")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment