[Checkins] SVN: zope.configuration/trunk/src/zope/configuration/tests/test_ Normalize filesystem paths FBO Windows.
Tres Seaver
cvs-admin at zope.org
Wed May 16 16:34:14 UTC 2012
Log message for revision 125893:
Normalize filesystem paths FBO Windows.
Changed:
U zope.configuration/trunk/src/zope/configuration/tests/test_config.py
U zope.configuration/trunk/src/zope/configuration/tests/test_fields.py
U zope.configuration/trunk/src/zope/configuration/tests/test_name.py
-=-
Modified: zope.configuration/trunk/src/zope/configuration/tests/test_config.py
===================================================================
--- zope.configuration/trunk/src/zope/configuration/tests/test_config.py 2012-05-16 16:12:09 UTC (rev 125892)
+++ zope.configuration/trunk/src/zope/configuration/tests/test_config.py 2012-05-16 16:34:11 UTC (rev 125893)
@@ -124,13 +124,17 @@
del sys.modules[name]
def test_path_w_absolute_filename(self):
+ import os
c = self._makeOne()
- self.assertEqual(c.path('/path/to/somewhere'), '/path/to/somewhere')
+ self.assertEqual(c.path('/path/to/somewhere'),
+ os.path.normpath('/path/to/somewhere'))
def test_path_w_relative_filename_w_basepath(self):
+ import os
c = self._makeOne()
c.basepath = '/path/to'
- self.assertEqual(c.path('somewhere'), '/path/to/somewhere')
+ self.assertEqual(c.path('somewhere'),
+ os.path.normpath('/path/to/somewhere'))
def test_path_w_relative_filename_wo_basepath_wo_package(self):
import os
@@ -157,7 +161,7 @@
__path__ = [os.path.join('relative', 'path')]
c = self._makeOne()
c.package = stub()
- os.path.isabs(c.path('y/z'))
+ self.assertTrue(os.path.isabs(c.path('y/z')))
def test_checkDuplicate_miss(self):
c = self._makeOne()
@@ -165,22 +169,25 @@
self.assertEqual(list(c._seen_files), ['/path'])
def test_checkDuplicate_hit(self):
+ import os
from zope.configuration.exceptions import ConfigurationError
c = self._makeOne()
c.checkDuplicate('/path')
self.assertRaises(ConfigurationError, c.checkDuplicate, '/path')
- self.assertEqual(list(c._seen_files), ['/path'])
+ self.assertEqual(list(c._seen_files), [os.path.normpath('/path')])
def test_processFile_miss(self):
+ import os
c = self._makeOne()
self.assertEqual(c.processFile('/path'), True)
- self.assertEqual(list(c._seen_files), ['/path'])
+ self.assertEqual(list(c._seen_files), [os.path.normpath('/path')])
def test_processFile_hit(self):
+ import os
c = self._makeOne()
c.processFile('/path')
self.assertEqual(c.processFile('/path'), False)
- self.assertEqual(list(c._seen_files), ['/path'])
+ self.assertEqual(list(c._seen_files), [os.path.normpath('/path')])
def test_action_defaults_no_info_no_includepath(self):
DISCRIMINATOR = ('a', ('b',), 0)
Modified: zope.configuration/trunk/src/zope/configuration/tests/test_fields.py
===================================================================
--- zope.configuration/trunk/src/zope/configuration/tests/test_fields.py 2012-05-16 16:12:09 UTC (rev 125892)
+++ zope.configuration/trunk/src/zope/configuration/tests/test_fields.py 2012-05-16 16:34:11 UTC (rev 125893)
@@ -190,8 +190,9 @@
return self._getTargetClass()(*args, **kw)
def test_fromUnicode_absolute(self):
+ import os
path = self._makeOne()
- self.assertEqual(path.fromUnicode('/'), '/')
+ self.assertEqual(path.fromUnicode('/'), os.path.normpath('/'))
def test_fromUnicode_relative(self):
class Context(object):
Modified: zope.configuration/trunk/src/zope/configuration/tests/test_name.py
===================================================================
--- zope.configuration/trunk/src/zope/configuration/tests/test_name.py 2012-05-16 16:12:09 UTC (rev 125892)
+++ zope.configuration/trunk/src/zope/configuration/tests/test_name.py 2012-05-16 16:34:11 UTC (rev 125893)
@@ -107,7 +107,9 @@
return path(*args, **kw)
def test_absolute(self):
- self.assertEqual(self._callFUT('/absolute'), '/absolute')
+ import os
+ self.assertEqual(self._callFUT('/absolute'),
+ os.path.normpath('/absolute'))
def test_relative_bogus_package(self):
self.assertRaises(ImportError,
More information about the checkins
mailing list