Esempio n. 1
0
    def test_unidiff_mixed( self ):

        from Products.GenericSetup.differ import unidiff

        diff_lines = unidiff( ONE_FOUR, ZERO_FOUR.splitlines() )
        diff_text = '\n'.join( diff_lines )
        self.assertEqual( diff_text, DIFF_TEXT )
Esempio n. 2
0
    def test_unidiff_mixed(self):

        from Products.GenericSetup.differ import unidiff

        diff_lines = unidiff(ONE_FOUR, ZERO_FOUR.splitlines())
        diff_text = '\n'.join(diff_lines)
        self.assertEqual(diff_text, DIFF_TEXT)
    def test_unidiff_both_text(self):

        from Products.GenericSetup.differ import unidiff

        diff_lines = unidiff(ONE_FOUR, ZERO_FOUR)
        diff_text = b'\n'.join(diff_lines)
        self.assertEqual(diff_text, DIFF_TEXT)
Esempio n. 4
0
    def test_unidiff_ignore_blanks(self):

        from Products.GenericSetup.differ import unidiff

        double_spaced = ONE_FOUR.replace("\n", "\n\n")
        diff_lines = unidiff(double_spaced, ZERO_FOUR.splitlines(), ignore_blanks=True)

        diff_text = "\n".join(diff_lines)
        self.assertEqual(diff_text, DIFF_TEXT)
    def test_unidiff_both_lines( self ):

        from Products.GenericSetup.differ import unidiff

        diff_lines = unidiff( ONE_FOUR.splitlines(), ZERO_FOUR.splitlines() )
        diff_text = '\n'.join( diff_lines )
        if PYTHON27:
            self.assertEqual( diff_text, DIFF_TEXT_27 )
        else:
            self.assertEqual( diff_text, DIFF_TEXT )
Esempio n. 6
0
    def test_unidiff_both_lines(self):

        from Products.GenericSetup.differ import unidiff

        diff_lines = unidiff(ONE_FOUR.splitlines(), ZERO_FOUR.splitlines())
        diff_text = '\n'.join(diff_lines)
        if PYTHON27:
            self.assertEqual(diff_text, DIFF_TEXT_27)
        else:
            self.assertEqual(diff_text, DIFF_TEXT)
Esempio n. 7
0
    def test_unidiff_ignore_blanks(self):

        from Products.GenericSetup.differ import unidiff

        double_spaced = ONE_FOUR.replace('\n', '\n\n')
        diff_lines = unidiff(double_spaced,
                             ZERO_FOUR.splitlines(),
                             ignore_blanks=True)

        diff_text = '\n'.join(diff_lines)
        self.assertEqual(diff_text, DIFF_TEXT)
Esempio n. 8
0
    def test_unidiff_ignore_blanks(self):

        from Products.GenericSetup.differ import unidiff

        double_spaced = ONE_FOUR.replace('\n', '\n\n')
        diff_lines = unidiff(double_spaced, ZERO_FOUR.splitlines(), ignore_blanks=True
                             )

        diff_text = '\n'.join(diff_lines)
        if PYTHON27:
            self.assertEqual(diff_text, DIFF_TEXT_27)
        else:
            self.assertEqual(diff_text, DIFF_TEXT)