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

rework of where tests

parent 6fc1faf3
No related merge requests found
......@@ -29,22 +29,19 @@ def test_from():
from_stmt(" ")
def test_where():
lhs = "lhs"
rhs = "rhs"
assert where_stmt(lhs, rhs).strip() == f"WHERE {lhs}={rhs}"
with pytest.raises(ValueError):
where_stmt("", lhs)
with pytest.raises(ValueError):
where_stmt(" ", lhs)
with pytest.raises(ValueError):
where_stmt(rhs, "")
with pytest.raises(ValueError):
where_stmt(rhs, " ")
@pytest.mark.parametrize("lhs", ["lhs", " lhs ", "lhs "])
@pytest.mark.parametrize("rhs", ["rhs", "rhs ", " rhs "])
def test_where_strip(lhs, rhs):
assert where_stmt(lhs, rhs).strip() == "WHERE lhs=rhs"
@pytest.mark.parametrize("lhs", ["", " ", " "])
@pytest.mark.parametrize("rhs", ["rhs", "rhs ", " rhs "])
def test_invalid_lhs_wheres(lhs, rhs):
with pytest.raises(ValueError):
where_stmt(rhs, lhs, "")
where_stmt(lhs, rhs)
with pytest.raises(ValueError):
where_stmt(rhs, lhs, " ")
where_stmt(rhs, lhs)
def test_join():
......
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