[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/VFS/tests - testOSFileSystem.py:1.1.4.2
Shane Hathaway
shane@cvs.zope.org
Wed, 24 Apr 2002 11:37:57 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Server/VFS/tests
In directory cvs.zope.org:/tmp/cvs-serv5431/VFS/tests
Modified Files:
Tag: Zope-3x-branch
testOSFileSystem.py
Log Message:
Fixed most of the Windows test failures. Used the posixpath module instead of
os.path where appropriate. (Yay WINE! :-) )
=== Zope3/lib/python/Zope/Server/VFS/tests/testOSFileSystem.py 1.1.4.1 => 1.1.4.2 ===
def testNormalize(self):
- self.assertEqual(self.filesystem.normalize('/foo/bar//'), '/foo/bar')
- self.assertEqual(self.filesystem.normalize('/foo//bar'), '/foo/bar')
- self.assertEqual(self.filesystem.normalize('///foo/bar'), '/foo/bar')
- self.assertEqual(self.filesystem.normalize('///foo//bar////'),
- '/foo/bar')
+ def norm(p):
+ return self.filesystem.normalize(p).replace(os.sep, '/')
- self.assertEqual(self.filesystem.normalize('../foo/bar'), '/')
- self.assertEqual(self.filesystem.normalize('..'), '/')
- self.assertEqual(self.filesystem.normalize('/..'), '/')
- self.assertEqual(self.filesystem.normalize('/foo/..'), '/')
- self.assertEqual(self.filesystem.normalize('/foo/../bar'), '/bar')
- self.assertEqual(self.filesystem.normalize('../../'), '/')
+ self.assertEqual(norm('/foo/bar//'), '/foo/bar')
+ self.assertEqual(norm('/foo//bar'), '/foo/bar')
+ self.assertEqual(norm('///foo/bar'), '/foo/bar')
+ self.assertEqual(norm('///foo//bar////'), '/foo/bar')
- self.assertEqual(self.filesystem.normalize('///../foo/bar'), '/foo/bar')
- self.assertEqual(self.filesystem.normalize('/foo/..///'), '/')
- self.assertEqual(self.filesystem.normalize('///foo/..//bar'), '/bar')
- self.assertEqual(self.filesystem.normalize('..///../'), '/')
+ self.assertEqual(norm('../foo/bar'), '/')
+ self.assertEqual(norm('..'), '/')
+ self.assertEqual(norm('/..'), '/')
+ self.assertEqual(norm('/foo/..'), '/')
+ self.assertEqual(norm('/foo/../bar'), '/bar')
+ self.assertEqual(norm('../../'), '/')
+
+ self.assertEqual(norm('///../foo/bar'), '/foo/bar')
+ self.assertEqual(norm('/foo/..///'), '/')
+ self.assertEqual(norm('///foo/..//bar'), '/bar')
+ self.assertEqual(norm('..///../'), '/')
def testTranslate(self):