From 37985fc34cc966bce35dbe4faceda92db3f8b8da Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Tue, 18 Feb 2014 14:24:29 +0000 Subject: add the https clone test --- test.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test.py b/test.py index d44e84e..a79ccd0 100755 --- a/test.py +++ b/test.py @@ -17,12 +17,12 @@ def remote_runcmd(url, command): # Err find out why this doesn't work when i'm less frazzled #subprocess.Popen(['ssh', url] + command, shell=True) -def run_git(args, working_dir): +def run_git(args, working_dir, env=None): #return cliapp.runcmd(['git'] + args, **kwargs) #print 'args', args #print ['git'] + args - p = subprocess.Popen(['git'] + args, cwd=working_dir) + p = subprocess.Popen(['git'] + args, cwd=working_dir, env=env) return_code = p.wait() if return_code != 0: @@ -54,10 +54,10 @@ def create_test_repo(remote_url, project, repo): remote_runcmd(remote_url, ['create', "%s/%s/%s" % (trove_id, project, repo)]) -def can_clone(url): +def can_clone(url, env=None): workspace_dir = tempfile.mkdtemp() - run_git(['clone', url], workspace_dir) + run_git(['clone', url], workspace_dir, env) shutil.rmtree(workspace_dir) @@ -149,4 +149,12 @@ can_clone('http://%s/git/delta/zip' % trove_id) try: can_push('http://%s/git/delta/zip' % trove_id, 'zip') except: - print("That's great, we're expecting this to fail!") \ No newline at end of file + print("That's great, we're expecting this to fail!") + +# Ok, now for https +username = 'richardipsum' +password = 'quack' + +can_clone('https://%s:%s@%s/git/%s/%s/%s' % + (username, password, trove_id, trove_id, project, repo), + env={'GIT_SSL_NO_VERIFY': '1'}) -- cgit v1.2.1