Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_standardise_quotes():
v = '"the_geom from (select * from road where "name_e"=\'Trans-Canada Highway\' order by gid) as foo using unique gid using srid=3978"'
q = Quoter(quote='"')
v2 = q.standardise_quotes(v)
exp = r'''"the_geom from (select * from road where \"name_e\"='Trans-Canada Highway' order by gid) as foo using unique gid using srid=3978"'''
assert(v2 == exp)
q = Quoter(quote="'")
v2 = q.standardise_quotes(v)
exp = r"""'the_geom from (select * from road where "name_e"=\'Trans-Canada Highway\' order by gid) as foo using unique gid using srid=3978'"""
assert(v2 == exp)
def __init__(self, indent=4, spacer=" ", quote='"', newlinechar="\n", end_comment=False, **kwargs):
"""
Option use "\t" for spacer with an indent of 1
"""
assert (quote == "'" or quote == '"')
self.indent = indent
self.spacer = spacer * self.indent
self.quoter = Quoter(quote)
self.newlinechar = newlinechar
self.end_comment = end_comment
self.end = u"END"
self.validator = Validator()
def __init__(self, include_position=False, include_comments=False):
self.quoter = Quoter()
self.include_position = include_position
self.include_comments = include_comments