예제 #1
0
    def ndiffAssertEqual(self, first, second):
        """Like failUnlessEqual except use ndiff for readable output."""
        if first != second:
            # Using the built-in .splitlines() method here will cause incorrect
            # results when splitting statements that have quoted CR/CR+LF
            # characters.
            sfirst = split_unquoted_newlines(u(first))
            ssecond = split_unquoted_newlines(u(second))
            diff = difflib.ndiff(sfirst, ssecond)

            fp = StringIO()
            fp.write('\n')
            fp.write('\n'.join(diff))

            raise self.failureException(fp.getvalue())
예제 #2
0
    def ndiffAssertEqual(self, first, second):
        """Like failUnlessEqual except use ndiff for readable output."""
        if first != second:
            # Using the built-in .splitlines() method here will cause incorrect
            # results when splitting statements that have quoted CR/CR+LF
            # characters.
            sfirst = split_unquoted_newlines(u(first))
            ssecond = split_unquoted_newlines(u(second))
            diff = difflib.ndiff(sfirst, ssecond)

            fp = StringIO()
            fp.write('\n')
            fp.write('\n'.join(diff))

            raise self.failureException(fp.getvalue())
예제 #3
0
 def process(stmt):
     lines = split_unquoted_newlines(stmt)
     return '\n'.join(line.rstrip() for line in lines)
예제 #4
0
 def process(self, stack, stmt):
     raw = unicode(stmt)
     lines = split_unquoted_newlines(raw)
     res = '\n'.join(line.rstrip() for line in lines)
     return res
예제 #5
0
 def process(stmt):
     lines = split_unquoted_newlines(stmt)
     return '\n'.join(line.rstrip() for line in lines)
예제 #6
0
 def process(self, stack, stmt):
     raw = str(stmt)
     lines = split_unquoted_newlines(raw)
     res = "\n".join(line.rstrip() for line in lines)
     return res
예제 #7
0
파일: filters.py 프로젝트: yodebu/sqlparse
 def process(self, stack, stmt):
     raw = unicode(stmt)
     lines = split_unquoted_newlines(raw)
     res = '\n'.join(line.rstrip() for line in lines)
     return res
예제 #8
0
 def process(stmt):
     raw = text_type(stmt)
     lines = split_unquoted_newlines(raw)
     return '\n'.join(line.rstrip() for line in lines)