Esempio n. 1
0
    def array_out(self, ar):
        result = []
        for v in ar:

            if isinstance(v, list):
                val = self.array_out(v)

            elif v is None:
                val = 'NULL'

            elif isinstance(v, str):
                val = converters.array_string_escape(v)

            else:
                _, val = self.make_param(v)

            result.append(val)

        return '{' + ','.join(result) + '}'
Esempio n. 2
0
def test_array_string_escape():
    v = '"'
    res = array_string_escape(v)
    assert res == '"\\""'