Skip to content

Commit

Permalink
Various fixes to the portable test code that I missed the last time a…
Browse files Browse the repository at this point in the history
…round
  • Loading branch information
dabrahams committed May 3, 2010
1 parent 75ff1e9 commit 1473955
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions tests/test_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def test_cleanup_after_install_from_local_directory():
Test clean up after installing from a local directory.
"""
reset_env()
env = reset_env()
to_install = abspath(join(here, 'packages', 'FSPkg'))
result = run_pip('install', to_install, expect_error=False)
build = join(base_path, "build")
src = join(base_path, "src")
build = env.env_path/'build'
src = env.env_path/'src'
assert not exists(build), "unexpected build/ dir exists: %s" % build
assert not exists(src), "unexpected src/ dir exist: %s" % src

Expand All @@ -48,11 +48,11 @@ def test_cleanup_after_create_bundle():
Test clean up after making a bundle. Make sure (build|src)-bundle/ dirs are removed but not src/.
"""
reset_env()
env = reset_env()
# Install an editable to create a src/ dir.
dummy = run_pip('install', '-e', 'git://github.com/jezdez/django-feedutil.git#egg=django-feedutil')
build = join(base_path, "build")
src = join(base_path, "src")
build = env.env_path/"build"
src = env.env_path/"src"
assert not exists(build), "build/ dir still exists: %s" % build
assert exists(src), "expected src/ dir doesn't exist: %s" % src

Expand All @@ -64,8 +64,8 @@ def test_cleanup_after_create_bundle():
pip''' % fspkg)
write_file('bundle-req.txt', pkg_lines)
result = run_pip('bundle', '-r', 'bundle-req.txt', 'test.pybundle')
build_bundle = join(base_path, "build-bundle")
src_bundle = join(base_path, "src-bundle")
build_bundle = env.scratch_path/"build-bundle"
src_bundle = env.scratch_path/"src-bundle"
assert not exists(build_bundle), "build-bundle/ dir still exists: %s" % build_bundle
assert not exists(src_bundle), "src-bundle/ dir still exists: %s" % src_bundle

Expand Down
6 changes: 3 additions & 3 deletions tests/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_freeze():
# and something else to test out:
simplejson<=1.7.4
"""))
result = run_pip('install', '-r', env.base_path/ 'initools-req.txt')
result = run_pip('install', '-r', env.scratch_path/'initools-req.txt')
result = run_pip('freeze', expect_stderr=True)
expected = textwrap.dedent("""\
Script result: pip freeze
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_freeze_mercurial_clone():
checker = OutputChecker()
result = env.run('hg', 'clone', '-r', 'f8f7eaf275c5', 'http://bitbucket.org/jezdez/django-dbtemplates/', 'django-dbtemplates')
result = env.run('python', 'setup.py', 'develop',
cwd=os.path.join(env.base_path, 'django-dbtemplates'))
cwd=env.scratch_path/'django-dbtemplates')
result = run_pip('freeze', expect_stderr=True)
expected = textwrap.dedent("""\
Script result: ...pip freeze
Expand Down Expand Up @@ -141,7 +141,7 @@ def test_freeze_bazaar_clone():
checker = OutputChecker()
result = env.run('bzr', 'checkout', '-r', '174', 'http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1/', 'django-wikiapp')
result = env.run(os.path.join(env.bin_dir, 'python'), 'setup.py', 'develop',
cwd=os.path.join(env.base_path, 'django-wikiapp'))
cwd=env.scratch_path/'django-wikiapp')
result = run_pip('freeze', expect_stderr=True)
expected = textwrap.dedent("""\
Script result: ...pip freeze
Expand Down
2 changes: 1 addition & 1 deletion tests/test_uninstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_uninstall_console_scripts():
"""
env = reset_env()
result = run_pip('install', 'virtualenv', expect_error=True)
assert (env.bin_dir/'virtualenv') in result.files_created, sorted(result.files_created.keys())
assert (env.relative_env_path/'bin'/'virtualenv') in result.files_created, sorted(result.files_created.keys())
result2 = run_pip('uninstall', 'virtualenv', '-y', expect_error=True)
assert diff_states(result.files_before, result2.files_after, ignore=[env.relative_env_path/'build', 'cache']).values() == [{}, {}, {}]

Expand Down

0 comments on commit 1473955

Please sign in to comment.