Commit d9f5c90b authored by Chris Withers's avatar Chris Withers

Fixed line ending problems causing test failure. Binary mode not appropriate...

Fixed line ending problems causing test failure. Binary mode not appropriate as CVS checks otu with different line endings depending on the OS.
parent fea192fb
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
"""Document Template Tests """Document Template Tests
""" """
__rcs_id__='$Id: testDTML.py,v 1.9 2001/11/28 15:50:56 matt Exp $' __rcs_id__='$Id: testDTML.py,v 1.10 2002/02/06 19:13:36 chrisw Exp $'
__version__='$Revision: 1.9 $'[11:-2] __version__='$Revision: 1.10 $'[11:-2]
import sys, os import sys, os
import unittest import unittest
...@@ -26,7 +26,7 @@ else: ...@@ -26,7 +26,7 @@ else:
here = tests.__path__[0] here = tests.__path__[0]
def read_file(name): def read_file(name):
f = open(os.path.join(here, name), 'rb') f = open(os.path.join(here, name), 'r')
res = f.read() res = f.read()
f.close() f.close()
return res return res
...@@ -43,7 +43,6 @@ class D: ...@@ -43,7 +43,6 @@ class D:
def d(**kw): return kw def d(**kw): return kw
class DTMLTests (unittest.TestCase): class DTMLTests (unittest.TestCase):
doc_class = HTML doc_class = HTML
...@@ -163,7 +162,7 @@ class DTMLTests (unittest.TestCase): ...@@ -163,7 +162,7 @@ class DTMLTests (unittest.TestCase):
html=self.doc_class(read_file('dealers.dtml')) html=self.doc_class(read_file('dealers.dtml'))
res = html(inventory=items, first_ad=15) res = html(inventory=items, first_ad=15)
expected = read_file('dealers.out') expected = read_file('dealers.out')
assert res == expected, res self.assertEqual(res,expected)
def testSequenceSummaries(self): def testSequenceSummaries(self):
def d(**kw): return kw def d(**kw): return kw
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment