Commits

Hugo Lopes Tavares  committed 7b106bf

added changes to make it easier to add ianb suggestions (local_repo should chekout the repos and the repos are not tracked with pip source code)

  • Participants
  • Parent commits ff3d4c1

Comments (0)

Files changed (4)

File tests/test_basic.py

 import filecmp
 from os.path import abspath, join, curdir, pardir
 from test_pip import (here, reset_env, run_pip, pyversion, mkdir,
-                       git_repos, mercurial_repos, bazaar_repos,
-                       subversion_repos, src_folder)
+                       src_folder, local_repo)
 from path import Path
 
 
     reset_env()
     result = run_pip('install',
                      '-e',
-                     'svn+file://%s/INITools/trunk#egg=initools-dev' % subversion_repos)
+                     '%s#egg=initools-dev' %
+                     local_repo('svn+http://svn.colorstudy.com/INITools/trunk'))
     result.assert_installed('INITools', with_files=['.svn'])
 
 
     mkdir('customdl')
     result = run_pip('install',
                      '-e',
-                     'svn+file://%s/INITools/trunk#egg=initools-dev' % subversion_repos,
+                     '%s#egg=initools-dev' % local_repo('svn+http://svn.colorstudy.com/INITools/trunk'),
                      '--src',
                      'customsrc',
                      '--download',
 
     result = run_pip('install',
                      '-e',
-                     'svn+file://%s/INITools/trunk#egg=initools-dev' % subversion_repos,
+                     '%s#egg=initools-dev' % local_repo('svn+http://svn.colorstudy.com/INITools/trunk'),
                      '--no-install', expect_error=True)
     result.assert_installed('INITools', without_egg_link=True, with_files=['.svn'])
 
     result = run_pip('install',
                      '-e',
-                     'svn+file://%s/INITools/trunk#egg=initools-dev' % subversion_repos,
-                     '--no-download', expect_error=True)
+                     '%s#egg=initools-dev' % local_repo('svn+http://svn.colorstudy.com/INITools/trunk'),                     '--no-download', expect_error=True)
     result.assert_installed('INITools', without_files=[curdir, '.svn'])
 
 
     """
     reset_env()
     result = run_pip('install', '-e',
-                     'git+file://%s/django-feedutil/#egg=django-feedutil' % git_repos,
+                     '%s#egg=django-feedutil' % local_repo('git://github.com/jezdez/django-feedutil.git'),
                      expect_error=True)
     result.assert_installed('django-feedutil', with_files=['.git'])
 
     """
     reset_env()
     result = run_pip('install', '-e',
-                     'hg+file://%s/django-registration#egg=django-registration' % mercurial_repos,
+                     '%s#egg=django-registration' %
+                     local_repo('hg+http://bitbucket.org/ubernostrum/django-registration'),
                      expect_error=True)
     result.assert_installed('django-registration', with_files=['.hg'])
 
     """
     reset_env()
     result = run_pip('install', '-e',
-                     'hg+file://%s/django-registration/#egg=django-registration' % mercurial_repos,
+                     '%s/#egg=django-registration' %
+                     local_repo('hg+http://bitbucket.org/ubernostrum/django-registration'),
                      expect_error=True)
     assert 'pip-log.txt' not in result.files_created, result.files_created['pip-log.txt'].bytes
 
     """
     reset_env()
     result = run_pip('install', '-e',
-                     'bzr+file://%s/django-wikiapp-release-0.1/@174#egg=django-wikiapp' % bazaar_repos,
+                     '%s/@174#egg=django-wikiapp' %
+                     local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'),
                      expect_error=True)
     result.assert_installed('django-wikiapp', with_files=['.bzr'])
 
     """
     reset_env()
     result = run_pip('install', '-e',
-                     'bzr+file://%s/%%7Edjango-wikiapp-release-0.1/#egg=django-wikiapp' % bazaar_repos,
+                     '%s/#egg=django-wikiapp' %
+                     local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'),
                      expect_error=True)
     assert 'pip-log.txt' not in result.files_created, result.files_created['pip-log.txt'].bytes
 

File tests/test_bundle.py

 import textwrap
 from os.path import join
 from test_pip import (here, reset_env, run_pip, write_file,
-                       subversion_repos)
+                       local_repo)
 from path import Path
 from pip.util import path_to_url2
 
     run_pip('install', '-e', fspkg)
     pkg_lines = textwrap.dedent('''\
             -e %s
-            -e svn+file://%s/INITools/trunk#egg=initools-dev
-            pip''' % (fspkg, subversion_repos))
+            -e %s#egg=initools-dev
+            pip''' % (fspkg, local_repo('svn+http://svn.colorstudy.com/INITools/trunk')))
     write_file('bundle-req.txt', pkg_lines)
     # Create a bundle in env.scratch_path/ test.pybundle
     result = run_pip('bundle', '-r', env.scratch_path/ 'bundle-req.txt', env.scratch_path/ 'test.pybundle')

File tests/test_cleanup.py

 import textwrap
 from os.path import abspath, exists, join
 from test_pip import (here, reset_env, run_pip, write_file,
-                      mercurial_repos, subversion_repos)
+                      local_repo)
 
 
 def test_cleanup_after_install_from_pypi():
     env = reset_env()
     run_pip('install',
             '-e',
-            'hg+file://%s/django-registration/#egg=django-registration' % mercurial_repos,
+            '%s#egg=django-registration' %
+            local_repo('hg+http://bitbucket.org/ubernostrum/django-registration'),
             expect_error=True)
     build = env.venv_path/'build'
     src = env.venv_path/'src'
     fspkg = 'file://%s/FSPkg' %join(here, 'packages')
     pkg_lines = textwrap.dedent('''\
             -e %s
-            -e svn+file://%s/INITools/trunk#egg=initools-dev
-            pip''' % (fspkg, subversion_repos))
+            -e %s#egg=initools-dev
+            pip''' % (fspkg, local_repo('svn+http://svn.colorstudy.com/INITools/trunk')))
     write_file('bundle-req.txt', pkg_lines)
     run_pip('bundle', '-r', 'bundle-req.txt', 'test.pybundle')
     build_bundle = env.scratch_path/"build-bundle"

File tests/test_freeze.py

 import textwrap
 from doctest import OutputChecker, ELLIPSIS
 from test_pip import (reset_env, run_pip, write_file, get_env,
-                      mercurial_repos, git_repos, bazaar_repos)
+                      local_repo)
 
 distribute_re = re.compile('^distribute==[0-9.]+\n', re.MULTILINE)
 
     _check_output(result, expected)
 
     # Bah, that's no good!  Let's give it a hint::
-    result = run_pip('freeze', '-f', 'file://%s/INITools/trunk#egg=INITools-dev' % mercurial_repos, expect_stderr=True)
+    result = run_pip('freeze', '-f',
+                     '%s#egg=INITools-dev' %
+                     local_repo('http://svn.colorstudy.com/INITools/trunk'),
+                     expect_stderr=True)
     expected = textwrap.dedent("""\
-        Script result: ...pip freeze -f file://.../mercurial/INITools/trunk#egg=INITools-dev
+        Script result: ...pip freeze -f %(repo)s#egg=INITools-dev
         -- stdout: --------------------
-        -f file://.../mercurial/INITools/trunk#egg=INITools-dev
+        -f %(repo)s#egg=INITools-dev
         # Installing as editable to satisfy requirement INITools==...dev-r...:
-        -e svn+file://.../mercurial/INITools/trunk@...#egg=INITools-...dev_r...
+        -e svn+%(repo)s@...#egg=INITools-...dev_r...
         simplejson==1.7.4...
-        <BLANKLINE>""")
+        <BLANKLINE>""" % {'repo': local_repo('http://svn.colorstudy.com/INITools/trunk')})
     _check_output(result, expected)
 
 
 
     """
     env = reset_env()
-    result = env.run('git', 'clone', 'file://%s/django-pagination' % git_repos, 'django-pagination')
+    result = env.run('git', 'clone', local_repo('git://github.com/jezdez/django-pagination.git'), 'django-pagination')
     result = env.run('git', 'checkout', '1df6507872d73ee387eb375428eafbfc253dfcd8',
             cwd=env.scratch_path/'django-pagination', expect_stderr=True)
     result = env.run('python', 'setup.py', 'develop',
     expected = textwrap.dedent("""\
         Script result: ...pip freeze
         -- stdout: --------------------
-        -e git+file://%s/django-pagination@...#egg=django_pagination-...
-        ...""" % git_repos)
+        -e git+%s@...#egg=django_pagination-...
+        ...""" % local_repo('git://github.com/jezdez/django-pagination.git'))
     _check_output(result, expected)
 
     result = run_pip('freeze', '-f',
-                     'git+file://%s/django-pagination#egg=django_pagination' % git_repos,
+                     'git+%s#egg=django_pagination' % local_repo('git://github.com/jezdez/django-pagination.git'),
                      expect_stderr=True)
     expected = textwrap.dedent("""\
-        Script result: pip freeze -f git+file://%(repo)s/django-pagination#egg=django_pagination
+        Script result: pip freeze -f git+%(repo)s#egg=django_pagination
         -- stdout: --------------------
-        -f git+file://%(repo)s/django-pagination#egg=django_pagination
-        -e git+file://%(repo)s/django-pagination@...#egg=django_pagination-...-dev
-        ...""" % {'repo': git_repos})
+        -f git+%(repo)s#egg=django_pagination
+        -e git+%(repo)s@...#egg=django_pagination-...-dev
+        ...""" % {'repo': local_repo('git://github.com/jezdez/django-pagination.git')})
     _check_output(result, expected)
 
 
     env = get_env()
     result = env.run('hg', 'clone',
                      '-r', 'f8f7eaf275c5',
-                     'file://%s/django-dbtemplates/' % mercurial_repos,
+                     local_repo('http://bitbucket.org/jezdez/django-dbtemplates'),
                      'django-dbtemplates')
     result = env.run('python', 'setup.py', 'develop',
             cwd=env.scratch_path/'django-dbtemplates')
     expected = textwrap.dedent("""\
         Script result: ...pip freeze
         -- stdout: --------------------
-        -e hg+file://%s/django-dbtemplates@...#egg=django_dbtemplates-...
-        ...""" % mercurial_repos)
+        -e hg+%s@...#egg=django_dbtemplates-...
+        ...""" % local_repo('http://bitbucket.org/jezdez/django-dbtemplates'))
     _check_output(result, expected)
 
     result = run_pip('freeze', '-f',
-                     'hg+file://%s/django-dbtemplates#egg=django_dbtemplates' % mercurial_repos,
+                     'hg+%s#egg=django_dbtemplates' % local_repo('http://bitbucket.org/jezdez/django-dbtemplates'),
                      expect_stderr=True)
     expected = textwrap.dedent("""\
-        Script result: ...pip freeze -f hg+file://%(repo)s/django-dbtemplates#egg=django_dbtemplates
+        Script result: ...pip freeze -f hg+%(repo)s#egg=django_dbtemplates
         -- stdout: --------------------
-        -f hg+file://%(repo)s/django-dbtemplates#egg=django_dbtemplates
-        -e hg+file://%(repo)s/django-dbtemplates@...#egg=django_dbtemplates-...
-        ...""" % {'repo': mercurial_repos})
+        -f hg+%(repo)s#egg=django_dbtemplates
+        -e hg+%(repo)s@...#egg=django_dbtemplates-...
+        ...""" % {'repo': local_repo('http://bitbucket.org/jezdez/django-dbtemplates')})
     _check_output(result, expected)
 
 
     reset_env()
     env = get_env()
     result = env.run('bzr', 'checkout', '-r', '174',
-                     'file://%s/django-wikiapp-release-0.1' % bazaar_repos, 'django-wikiapp')
+                     local_repo('http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'),
+                     'django-wikiapp')
     result = env.run('python', 'setup.py', 'develop',
             cwd=env.scratch_path/'django-wikiapp')
     result = run_pip('freeze', expect_stderr=True)
     expected = textwrap.dedent("""\
         Script result: ...pip freeze
         -- stdout: --------------------
-        -e bzr+file://%s/django-wikiapp-release-0.1@...#egg=django_wikiapp-...
-        ...""" % bazaar_repos)
+        -e %s@...#egg=django_wikiapp-...
+        ...""" % local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'))
     _check_output(result, expected)
 
     result = run_pip('freeze', '-f',
-                     'bzr+file://%s/django-wikiapp-release-0.1/#egg=django-wikiapp' % bazaar_repos,
+                     '%s/#egg=django-wikiapp' %
+                     local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1'),
                      expect_stderr=True)
     expected = textwrap.dedent("""\
-        Script result: ...pip freeze -f bzr+file://%(repo)s/django-wikiapp-release-0.1/#egg=django-wikiapp
+        Script result: ...pip freeze -f %(repo)s/#egg=django-wikiapp
         -- stdout: --------------------
-        -f bzr+file://%(repo)s/django-wikiapp-release-0.1/#egg=django-wikiapp
-        -e bzr+file://%(repo)s/django-wikiapp-release-0.1@...#egg=django_wikiapp-...
-        ...""" % {'repo': bazaar_repos})
+        -f %(repo)s/#egg=django-wikiapp
+        -e %(repo)s@...#egg=django_wikiapp-...
+        ...""" % {'repo':
+                  local_repo('bzr+http://bazaar.launchpad.net/%7Edjango-wikiapp/django-wikiapp/release-0.1')})
     _check_output(result, expected)