Unittests: Account for b979fe19e5 (fix one test and add two more)
- Unused XML namespace declarations *are supposed* to be removed - XML namespace declarations that are used as prefix for elements/attributes *must not* be removed
This commit is contained in:
parent
ab1aa0e2f8
commit
32e7e5517f
2 changed files with 20 additions and 4 deletions
20
testscour.py
20
testscour.py
|
|
@ -931,12 +931,26 @@ class WellFormedXMLAmpersandInTextContent(unittest.TestCase):
|
|||
self.assertTrue( wellformed.find('<desc>Peanut Butter & Jelly</desc>') != -1,
|
||||
'Improperly serialized & in text content')
|
||||
|
||||
class WellFormedXMLNamespacePrefix(unittest.TestCase):
|
||||
class WellFormedXMLNamespacePrefixRemoveUnused(unittest.TestCase):
|
||||
def runTest(self):
|
||||
with open('unittests/xml-well-formed.svg') as f:
|
||||
wellformed = scour.scourString(f.read())
|
||||
self.assertTrue( wellformed.find('xmlns:foo=') != -1,
|
||||
'Improperly serialized namespace prefix declarations')
|
||||
self.assertTrue( wellformed.find('xmlns:foo=') == -1,
|
||||
'Improperly serialized namespace prefix declarations: Unused namespace decaration not removed')
|
||||
|
||||
class WellFormedXMLNamespacePrefixKeepUsedElementPrefix(unittest.TestCase):
|
||||
def runTest(self):
|
||||
with open('unittests/xml-well-formed.svg') as f:
|
||||
wellformed = scour.scourString(f.read())
|
||||
self.assertTrue( wellformed.find('xmlns:bar=') != -1,
|
||||
'Improperly serialized namespace prefix declarations: Used element prefix removed')
|
||||
|
||||
class WellFormedXMLNamespacePrefixKeepUsedAttributePrefix(unittest.TestCase):
|
||||
def runTest(self):
|
||||
with open('unittests/xml-well-formed.svg') as f:
|
||||
wellformed = scour.scourString(f.read())
|
||||
self.assertTrue( wellformed.find('xmlns:baz=') != -1,
|
||||
'Improperly serialized namespace prefix declarations: Used attribute prefix removed')
|
||||
|
||||
class NamespaceDeclPrefixesInXMLWhenNotInDefaultNamespace(unittest.TestCase):
|
||||
def runTest(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue