How to use the scour.scour.make_well_formed function in scour

To help you get started, we’ve selected a few scour examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scour-project / scour / test_scour.py View on Github external
def runTest(self):
        self.assertEqual(make_well_formed('<>&'), '<>&',
                         'Incorrectly translated unquoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_QUOT), '"',
                         'Incorrectly translated double-quoted double quote')
github scour-project / scour / test_scour.py View on Github external
def runTest(self):
        self.assertEqual(make_well_formed('<>&'), '<>&',
                         'Incorrectly translated unquoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
github scour-project / scour / test_scour.py View on Github external
self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_QUOT), '"',
                         'Incorrectly translated double-quoted double quote')
github scour-project / scour / test_scour.py View on Github external
self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_QUOT), '"',
                         'Incorrectly translated double-quoted double quote')
github scour-project / scour / test_scour.py View on Github external
def runTest(self):
        self.assertEqual(make_well_formed('<>&'), '<>&',
                         'Incorrectly translated unquoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')
github scour-project / scour / test_scour.py View on Github external
def runTest(self):
        self.assertEqual(make_well_formed('<>&'), '<>&',
                         'Incorrectly translated unquoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_QUOT), '"',
                         'Incorrectly translated double-quoted double quote')
github scour-project / scour / test_scour.py View on Github external
def runTest(self):
        self.assertEqual(make_well_formed('<>&'), '<>&',
                         'Incorrectly translated unquoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_QUOT), '"',
                         'Incorrectly translated double-quoted double quote')
github scour-project / scour / test_scour.py View on Github external
def runTest(self):
        self.assertEqual(make_well_formed('<>&'), '<>&',
                         'Incorrectly translated unquoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_QUOT), '"',
                         'Incorrectly translated double-quoted double quote')
github scour-project / scour / test_scour.py View on Github external
def runTest(self):
        self.assertEqual(make_well_formed('<>&'), '<>&',
                         'Incorrectly translated unquoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_APOS), '<>&',
                         'Incorrectly translated single-quoted XML entities')
        self.assertEqual(make_well_formed('<>&', XML_ENTS_ESCAPE_QUOT), '<>&',
                         'Incorrectly translated double-quoted XML entities')

        self.assertEqual(make_well_formed("'"), "'",
                         'Incorrectly translated unquoted single quote')
        self.assertEqual(make_well_formed('"'), '"',
                         'Incorrectly translated unquoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_QUOT), "'",
                         'Incorrectly translated double-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_APOS), '"',
                         'Incorrectly translated single-quoted double quote')

        self.assertEqual(make_well_formed("'", XML_ENTS_ESCAPE_APOS), ''',
                         'Incorrectly translated single-quoted single quote')
        self.assertEqual(make_well_formed('"', XML_ENTS_ESCAPE_QUOT), '"',
                         'Incorrectly translated double-quoted double quote')