Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos.buildout
Commits
2b57cb09
Commit
2b57cb09
authored
Apr 28, 2012
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I don't think we need a distribute-specific update test any more
parent
a18b558c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
56 deletions
+1
-56
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+1
-1
src/zc/buildout/upgrading_distribute.txt
src/zc/buildout/upgrading_distribute.txt
+0
-55
No files found.
src/zc/buildout/tests.py
View file @
2b57cb09
...
@@ -2878,7 +2878,7 @@ def test_suite():
...
@@ -2878,7 +2878,7 @@ def test_suite():
doctest.DocFileSuite(
doctest.DocFileSuite(
'
easy_install
.
txt
', '
downloadcache
.
txt
', '
dependencylinks
.
txt
',
'
easy_install
.
txt
', '
downloadcache
.
txt
', '
dependencylinks
.
txt
',
'
allowhosts
.
txt
', '
unzip
.
txt
',
'
upgrading_distribute
.
txt
',
'
allowhosts
.
txt
', '
unzip
.
txt
',
setUp=easy_install_SetUp,
setUp=easy_install_SetUp,
tearDown=zc.buildout.testing.buildoutTearDown,
tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([
checker=renormalizing.RENormalizing([
...
...
src/zc/buildout/upgrading_distribute.txt
deleted
100644 → 0
View file @
a18b558c
Installing distribute
---------------------
Some initial test setup:
>>> import sys
>>> import zc.buildout
>>> dest = tmpdir('sample-install')
Distribute is packaged as a tarball, which makes an easy_install call
necessary. In older versions of buildout, the
``_call_easy_install()`` method would call ``_get_dist()`` to get hold
of the setuptools path for calling easy_install. When an updated
"distribute" was found, this would try an install again, leading to an
infinite recursion.
The solution is to just use the distribute location found at import time, like
happens with the buildout and distribute location that is inserted in scripts'
paths.
We test this corner case by patching the ``_get_dist()`` call:
>>> def mock_get_dist(requirement, ws, always_unzip):
... raise RuntimeError("We should not get called")
When installing distribute itself, we expect the "Getting dist" message not to
be printed. We call ``_call_easy_install()`` directly and get an error
because of a non-existing tarball, but that's the OK for this corner case
test: we only want to test that ``_get_dist()`` isn't getting called:
>>> class MockDist(object):
... def __str__(self):
... return 'nonexisting.tgz'
... @property
... def project_name(self):
... # Testing corner case: there *is* actually
... # a newer distribute package on pypi than we
... # are running with, so it really installs it
... # and compares project_name. We're past the
... # point that we're testing, so we just raise
... # the normally expected error.
... raise zc.buildout.UserError(
... "Couldn't install: nonexisting.tgz")
>>> dist = MockDist()
>>> installer = zc.buildout.easy_install.Installer(
... dest=dest,
... links=[link_server],
... index=link_server+'index/',
... always_unzip=True)
>>> installer._get_dist = mock_get_dist
>>> installer._call_easy_install('distribute', None, dest, dist)
Traceback (most recent call last):
...
UserError: Couldn't install: nonexisting.tgz
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment