Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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')
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_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')
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')
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')
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')
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')
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')
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')