summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Bicking <ianb@colorstudy.com>2010-04-22 01:38:09 -0500
committerIan Bicking <ianb@colorstudy.com>2010-04-22 01:38:09 -0500
commit349f6094dfabc33c046c4baa44b414f4265aeed2 (patch)
treeada2e9ff7fb05e3a024b0946a3e28ccaa0b8c579
parent1397f923a596ae0ecd13d8a1a5fc7555d8297d29 (diff)
parentba464787e88990a4533e24e05263883b6fc8e5a6 (diff)
downloadpip-349f6094dfabc33c046c4baa44b414f4265aeed2.tar.gz
Automated merge with http://bitbucket.org/aconrad/pip/
-rw-r--r--docs/news.txt5
-rwxr-xr-xregen-docs5
-rw-r--r--tests/test_config.py12
-rwxr-xr-xtests/test_pip.py18
4 files changed, 32 insertions, 8 deletions
diff --git a/docs/news.txt b/docs/news.txt
index 9ed941f77..33d807cbb 100644
--- a/docs/news.txt
+++ b/docs/news.txt
@@ -1,6 +1,11 @@
News for pip
============
+tip
+---
+
+* Fixed opening of logfile with no directory name. Thanks Alexandre Conrad.
+
0.7
---
diff --git a/regen-docs b/regen-docs
index c08709dad..55dbb855c 100755
--- a/regen-docs
+++ b/regen-docs
@@ -9,7 +9,8 @@ fi
mkdir -p docs/_static docs/_build
sphinx-build -E -b html docs/ docs/_build || exit 1
if [ "$CMD" = "publish" ] ; then
- cd docs/_build
+ cd docs/
echo "Uploading files..."
- tar czvf - . | ssh flow.openplans.org 'ssh acura.openplans.org "cd /www/pip.openplans.org/htdocs/; tar xzvf -"'
+ scp -r _build/ root@cloudsilverlining.org:/var/lib/silverlining/writable-roots/bbdocs/pip.openplans.org/
+ ssh root@cloudsilverlining.org 'chown -R www-data:www-data /var/lib/silverlining/writable-roots/bbdocs/'
fi
diff --git a/tests/test_config.py b/tests/test_config.py
index b3af6c2b6..16079ae58 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -4,6 +4,8 @@ import textwrap
from test_pip import here, reset_env, run_pip, clear_environ, write_file
import os
+from pip.basecommand import open_logfile
+
def test_options_from_env_vars():
"""
Test if ConfigOptionParser reads env vars (e.g. not using PyPI here)
@@ -76,3 +78,13 @@ def test_config_file_override_stack():
assert "Getting page http://pypi.appspot.com/INITools" not in result.stdout
assert "Getting page http://pypi.python.org/simple/INITools" in result.stdout
+def test_log_file_no_directory():
+ """
+ Test opening a log file with no directory name.
+
+ """
+ fp = open_logfile('testpip.log')
+ fp.write('can write')
+ fp.close()
+ assert os.path.exists(fp.name)
+ os.remove(fp.name)
diff --git a/tests/test_pip.py b/tests/test_pip.py
index a540e1a1a..e4efe84ef 100755
--- a/tests/test_pip.py
+++ b/tests/test_pip.py
@@ -42,13 +42,20 @@ def reset_env(environ=None):
environ['PIP_DOWNLOAD_CACHE'] = download_cache
environ['PIP_NO_INPUT'] = '1'
environ['PIP_LOG_FILE'] = os.path.join(base_path, 'pip-log.txt')
+ # put the test-scratch virtualenv's bin dir first on the script path
+ environ['PATH'] = "%s%s%s" % (virtualenv_bin_dir(base_path), os.pathsep, environ['PATH'])
- env = TestFileEnvironment(base_path, ignore_hidden=False, environ=environ)
+ env = TestFileEnvironment(base_path, ignore_hidden=False, environ=environ,
+ capture_temp=True, assert_no_temp=True)
env.run(sys.executable, '-m', 'virtualenv', '--no-site-packages', env.base_path)
- # put the test-scratch virtualenv's bin dir first on the script path
- env.script_path.insert(0, virtualenv_bin_dir(env.base_path))
-
+ # test that test-scratch virtualenv creation produced sensible venv python
+ result = env.run('python', '-c', 'import sys; print sys.executable')
+ pythonbin = result.stdout.strip()
+ if pythonbin != os.path.join(virtualenv_bin_dir(env.base_path), "python"):
+ raise RuntimeError("Python sys.executable (%r) isn't the "
+ "test-scratch venv python" % pythonbin)
+
# make sure we have current setuptools to avoid svn incompatibilities
env.run('easy_install', 'setuptools==0.6c11')
@@ -100,7 +107,7 @@ def diff_states(start, end, ignore=None):
Ignores mtime and other file attributes; only presence/absence and
size are considered.
-
+
"""
ignore = ignore or []
start_keys = set([k for k in start.keys()
@@ -118,4 +125,3 @@ def diff_states(start, end, ignore=None):
if __name__ == '__main__':
sys.stderr.write("Run pip's tests using nosetests. Requires virtualenv, ScriptTest, and nose.\n")
sys.exit(1)
-