Update unittest harness script so that things pass in Windows

This commit is contained in:
JSCHILL1 2009-11-13 12:59:06 -06:00
parent 4198961174
commit 8caa66edf9
2 changed files with 18 additions and 18 deletions

View file

@ -15,7 +15,7 @@
</header> </header>
<p>TBD</p> <p>TBD</p>
<ul> <ul>
<li>...</li> <li>Fix <a href="https://bugs.launchpad.net/scour/+bug/482215">Bug 482215</a> by using os.linesep to end lines</li>
</ul> </ul>
</section> </section>

View file

@ -828,15 +828,11 @@ class RemoveDefaultGradFYValue(unittest.TestCase):
class CDATAInXml(unittest.TestCase): class CDATAInXml(unittest.TestCase):
def runTest(self): def runTest(self):
self.assertEquals( scour.scourString(open('unittests/cdata.svg').read()), lines = scour.scourString(open('unittests/cdata.svg').read()).splitlines()
'''<?xml version="1.0" encoding="UTF-8" standalone="no"?> print lines[4]
<svg xmlns="http://www.w3.org/2000/svg"> self.assertEquals( lines[3],
<script type="application/ecmascript"><![CDATA[ " alert('pb&j');",
alert('pb&j'); 'CDATA did not come out correctly')
]]></script>
</svg>
''',
'Improperly serialized the cdata unit tests')
class WellFormedXMLLesserThanInAttrValue(unittest.TestCase): class WellFormedXMLLesserThanInAttrValue(unittest.TestCase):
def runTest(self): def runTest(self):
@ -930,23 +926,27 @@ class DoNotRemoveGradientsWhenReferencedInStyleCss(unittest.TestCase):
class DoNotPrettyPrintWhenWhitespacePreserved(unittest.TestCase): class DoNotPrettyPrintWhenWhitespacePreserved(unittest.TestCase):
def runTest(self): def runTest(self):
self.assertEquals( scour.scourString(open('unittests/whitespace-important.svg').read()), s = scour.scourString(open('unittests/whitespace-important.svg').read()).splitlines()
'''<?xml version="1.0" encoding="UTF-8" standalone="no"?> c = '''<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"> <svg xmlns="http://www.w3.org/2000/svg">
<text xml:space="preserve">This is some <tspan font-style="italic">messed-up</tspan> markup</text> <text xml:space="preserve">This is some <tspan font-style="italic">messed-up</tspan> markup</text>
</svg> </svg>
''', '''.splitlines()
'Whitespace not preserved') for i in range(4):
self.assertEquals( s[i], c[i],
'Whitespace not preserved for line ' + str(i))
class DoNotPrettyPrintWhenNestedWhitespacePreserved(unittest.TestCase): class DoNotPrettyPrintWhenNestedWhitespacePreserved(unittest.TestCase):
def runTest(self): def runTest(self):
self.assertEquals( scour.scourString(open('unittests/whitespace-nested.svg').read()), s = scour.scourString(open('unittests/whitespace-nested.svg').read()).splitlines()
'''<?xml version="1.0" encoding="UTF-8" standalone="no"?> c = '''<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"> <svg xmlns="http://www.w3.org/2000/svg">
<text xml:space="preserve"><tspan font-style="italic">Use <tspan font-style="bold">bold</tspan> text</tspan></text> <text xml:space="preserve"><tspan font-style="italic">Use <tspan font-style="bold">bold</tspan> text</tspan></text>
</svg> </svg>
''', '''.splitlines()
'Whitespace not preserved when nested') for i in range(4):
self.assertEquals( s[i], c[i],
'Whitespace not preserved when nested for line ' + str(i))
class GetAttrPrefixRight(unittest.TestCase): class GetAttrPrefixRight(unittest.TestCase):
def runTest(self): def runTest(self):