def test_prevent_double_quoting(self): assert odata("foo eq '{foo}'", foo="a string") == "foo eq 'a string'"
def test_escape_single_quote(self): assert odata("foo eq {foo}", foo="a '' str'ing") == "foo eq 'a '''' str''ing'"
def test_mixed(self): expected = "foo eq 'a string' and bar le 10" out = odata("foo eq {foo} and bar le {bar}", foo="a string", bar=10) assert out == expected
def test_string(self): assert odata("foo eq {foo}", foo="a string") == "foo eq 'a string'"
def test_numbers(self): assert odata("foo eq {foo}", foo=10) == "foo eq 10"
def test_const(self): assert odata("no escapes") == "no escapes"