Commit 58346265 authored by Godefroid Chapelle's avatar Godefroid Chapelle

Problem: some tests do not pass on Windows

Solution: fix them
parent b34b9bfd
...@@ -390,7 +390,7 @@ we'll get a user error, not a traceback:: ...@@ -390,7 +390,7 @@ we'll get a user error, not a traceback::
>>> print_(system(buildout), end='') >>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes' Develop: '/sample-buildout/recipes'
data-dir: Cannot create /xxx/mydata. /xxx is not a directory. data-dir: Cannot create .../xxx/mydata. .../xxx is not a directory.
While: While:
Installing. Installing.
Getting section data-dir. Getting section data-dir.
......
...@@ -145,6 +145,9 @@ class TestEasyInstall(unittest.TestCase): ...@@ -145,6 +145,9 @@ class TestEasyInstall(unittest.TestCase):
self.assertIsNotNone(result) self.assertIsNotNone(result)
self.assertEqual(result.version, '3.3') self.assertEqual(result.version, '3.3')
if zc.buildout.WINDOWS:
self.assertIn(dest.lower(), result.location)
else:
self.assertIn(dest, result.location) self.assertIn(dest, result.location)
......
...@@ -147,5 +147,5 @@ recipe instance: ...@@ -147,5 +147,5 @@ recipe instance:
demo 0.2 demo 0.2
other 1.0 other 1.0
demoneeded 1.1 demoneeded 1.1
extra paths: ['/foo/bar', '/spam/eggs'] extra paths: ['.../foo/bar', '.../spam/eggs']
...@@ -20,6 +20,7 @@ import shutil ...@@ -20,6 +20,7 @@ import shutil
import sys import sys
import zc.buildout.tests import zc.buildout.tests
import zc.buildout.testing import zc.buildout.testing
from zc.buildout import WINDOWS
import unittest import unittest
...@@ -37,7 +38,7 @@ def setUp(test): ...@@ -37,7 +38,7 @@ def setUp(test):
zc.buildout.testing.install_develop('zc.recipe.egg', test) zc.buildout.testing.install_develop('zc.recipe.egg', test)
def test_suite(): def test_suite():
suite = unittest.TestSuite(( suites = [
doctest.DocFileSuite( doctest.DocFileSuite(
'README.rst', 'README.rst',
setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown, setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
...@@ -84,31 +85,35 @@ def test_suite(): ...@@ -84,31 +85,35 @@ def test_suite():
]) ])
), ),
doctest.DocFileSuite( doctest.DocFileSuite(
'custom.rst', 'working_set_caching.rst',
setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown, setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS, optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings, zc.buildout.testing.normalize_endings,
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
zc.buildout.testing.python27_warning, ])
zc.buildout.testing.python27_warning_2,
(re.compile("(d ((ext)?demo(needed)?|other)"
r"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"),
'\\1V.V.egg'),
]),
), ),
]
if not WINDOWS:
suites.append(
doctest.DocFileSuite( doctest.DocFileSuite(
'working_set_caching.rst', 'custom.rst',
setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown, setUp=setUp, tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS, optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
checker=renormalizing.RENormalizing([ checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path, zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings, zc.buildout.testing.normalize_endings,
zc.buildout.testing.not_found, zc.buildout.testing.not_found,
]) zc.buildout.testing.python27_warning,
), zc.buildout.testing.python27_warning_2,
)) (re.compile("(d ((ext)?demo(needed)?|other)"
r"-\d[.]\d-py)\d[.]\d(-\S+)?[.]egg"),
'\\1V.V.egg'),
]),
)
)
suite = unittest.TestSuite(suites)
return suite return suite
if __name__ == '__main__': if __name__ == '__main__':
......
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