示例#1
0
 def test_prevent_double_quoting(self):
     assert odata("foo eq '{foo}'", foo="a string") == "foo eq 'a string'"
示例#2
0
 def test_escape_single_quote(self):
     assert odata("foo eq {foo}",
                  foo="a '' str'ing") == "foo eq 'a '''' str''ing'"
示例#3
0
 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
示例#4
0
 def test_string(self):
     assert odata("foo eq {foo}", foo="a string") == "foo eq 'a string'"
示例#5
0
 def test_numbers(self):
     assert odata("foo eq {foo}", foo=10) == "foo eq 10"
示例#6
0
 def test_const(self):
     assert odata("no escapes") == "no escapes"