Skip to content

Commit 78df68a

Browse files
committed
🚧 Updates clone command ; 📼 Betamax updates
1 parent 798a6d1 commit 78df68a

14 files changed

+638
-318
lines changed

git_repo/services/service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def fetch(self, remote, remote_branch, local_branch, force=False):
316316
update_head_ok=True, force=force, progress=pb)
317317
print()
318318

319-
def clone(self, user, repo, branch='master', rw=True):
319+
def clone(self, user, repo, branch=None, rw=True):
320320
'''Clones a new repository
321321
322322
:param user: namespace of the repository

tests/integration/cassettes/test_bitbucket_test_04_clone.json

+63-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"http_interactions": [
33
{
4-
"recorded_at": "2016-12-24T13:31:43",
4+
"recorded_at": "2017-05-03T23:17:10",
55
"request": {
66
"body": {
77
"encoding": "utf-8",
@@ -10,43 +10,93 @@
1010
"headers": {
1111
"Accept": "application/json",
1212
"Accept-Encoding": "identity",
13-
"Authorization": "Basic Z3V5em1vOkpKNHRsNHNzMTRuLmMwbQ==",
13+
"Authorization": "Basic Z3V5em1vOlF0WmpzZVFMaGE4NFBMZnRwaGJF",
1414
"Connection": "keep-alive",
1515
"From": "[email protected]",
16-
"User-Agent": "pybitbucket/0.11.2 python-requests/2.12.4"
16+
"User-Agent": "pybitbucket_fork/0.12.2 python-requests/2.13.0"
1717
},
1818
"method": "GET",
1919
"uri": "https://api.bitbucket.org/2.0/user"
2020
},
2121
"response": {
2222
"body": {
2323
"encoding": "utf-8",
24-
"string": "{\"username\": \"<BITBUCKET_NAMESPACE>\", \"website\": \"http://i.got.nothing.to/blog\", \"display_name\": \"Guyzmo\", \"uuid\": \"{abf29c83-e77e-4c9a-b5c7-38db801ef79e}\", \"links\": {\"hooks\": {\"href\": \"https://api.bitbucket.org/2.0/users/<BITBUCKET_NAMESPACE>/hooks\"}, \"self\": {\"href\": \"https://api.bitbucket.org/2.0/users/<BITBUCKET_NAMESPACE>\"}, \"repositories\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/<BITBUCKET_NAMESPACE>\"}, \"html\": {\"href\": \"https://bitbucket.org/<BITBUCKET_NAMESPACE>/\"}, \"followers\": {\"href\": \"https://api.bitbucket.org/2.0/users/<BITBUCKET_NAMESPACE>/followers\"}, \"avatar\": {\"href\": \"https://bitbucket.org/account/<BITBUCKET_NAMESPACE>/avatar/32/\"}, \"following\": {\"href\": \"https://api.bitbucket.org/2.0/users/<BITBUCKET_NAMESPACE>/following\"}, \"snippets\": {\"href\": \"https://api.bitbucket.org/2.0/snippets/<BITBUCKET_NAMESPACE>\"}}, \"created_on\": \"2008-09-20T15:08:53.695316+00:00\", \"location\": null, \"type\": \"user\"}"
24+
"string": "{\"username\": \"guyzmo\", \"website\": \"http://i.got.nothing.to/blog\", \"display_name\": \"Guyzmo\", \"account_id\": \"557058:8d7f5a89-3d0f-40ad-ad24-4727a2c1498b\", \"links\": {\"hooks\": {\"href\": \"https://api.bitbucket.org/2.0/users/guyzmo/hooks\"}, \"self\": {\"href\": \"https://api.bitbucket.org/2.0/users/guyzmo\"}, \"repositories\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo\"}, \"html\": {\"href\": \"https://bitbucket.org/guyzmo/\"}, \"followers\": {\"href\": \"https://api.bitbucket.org/2.0/users/guyzmo/followers\"}, \"avatar\": {\"href\": \"https://bitbucket.org/account/guyzmo/avatar/32/\"}, \"following\": {\"href\": \"https://api.bitbucket.org/2.0/users/guyzmo/following\"}, \"snippets\": {\"href\": \"https://api.bitbucket.org/2.0/snippets/guyzmo\"}}, \"created_on\": \"2008-09-20T15:08:53.695316+00:00\", \"is_staff\": false, \"location\": null, \"type\": \"user\", \"uuid\": \"{abf29c83-e77e-4c9a-b5c7-38db801ef79e}\"}"
2525
},
2626
"headers": {
2727
"Connection": "keep-alive",
28-
"Content-Length": "801",
28+
"Content-Length": "881",
2929
"Content-Type": "application/json; charset=utf-8",
30-
"Date": "Sat, 24 Dec 2016 13:31:42 GMT",
31-
"ETag": "\"321b3bdea810843db96c90951905a5e3\"",
30+
"Date": "Wed, 03 May 2017 23:17:10 GMT",
31+
"ETag": "\"85cedc52671c6a8a18bab9a454a65501\"",
3232
"Server": "nginx",
33-
"Strict-Transport-Security": "max-age=31536000",
33+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
3434
"Vary": "Authorization",
3535
"X-Accepted-OAuth-Scopes": "account",
3636
"X-Content-Type-Options": "nosniff",
3737
"X-Frame-Options": "SAMEORIGIN",
38-
"X-Render-Time": "0.0167880058289",
39-
"X-Request-Count": "458",
40-
"X-Served-By": "app-139",
41-
"X-Static-Version": "e72177d765d6",
42-
"X-Version": "e72177d765d6"
38+
"X-OAuth-Scopes": "snippet:write, snippet, repository:delete, repository:admin, pullrequest:write, repository, project:write, project, team, account",
39+
"X-Render-Time": "0.0430748462677",
40+
"X-Request-Count": "340",
41+
"X-Served-By": "app-140",
42+
"X-Static-Version": "1c299938c525",
43+
"X-Version": "1c299938c525"
4344
},
4445
"status": {
4546
"code": 200,
4647
"message": "OK"
4748
},
4849
"url": "https://api.bitbucket.org/2.0/user"
4950
}
51+
},
52+
{
53+
"recorded_at": "2017-05-03T23:17:11",
54+
"request": {
55+
"body": {
56+
"encoding": "utf-8",
57+
"string": ""
58+
},
59+
"headers": {
60+
"Accept": "application/json",
61+
"Accept-Encoding": "identity",
62+
"Authorization": "Basic Z3V5em1vOlF0WmpzZVFMaGE4NFBMZnRwaGJF",
63+
"Connection": "keep-alive",
64+
"From": "[email protected]",
65+
"User-Agent": "pybitbucket_fork/0.12.2 python-requests/2.13.0"
66+
},
67+
"method": "GET",
68+
"uri": "https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo"
69+
},
70+
"response": {
71+
"body": {
72+
"encoding": "utf-8",
73+
"string": "{\"scm\": \"git\", \"website\": \"\", \"has_wiki\": false, \"name\": \"git-repo\", \"links\": {\"watchers\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/watchers\"}, \"branches\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/refs/branches\"}, \"tags\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/refs/tags\"}, \"commits\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/commits\"}, \"clone\": [{\"href\": \"https://[email protected]/guyzmo/git-repo.git\", \"name\": \"https\"}, {\"href\": \"ssh://[email protected]/guyzmo/git-repo.git\", \"name\": \"ssh\"}], \"self\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo\"}, \"html\": {\"href\": \"https://bitbucket.org/guyzmo/git-repo\"}, \"avatar\": {\"href\": \"https://bitbucket.org/guyzmo/git-repo/avatar/32/\"}, \"hooks\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/hooks\"}, \"forks\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/forks\"}, \"downloads\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/downloads\"}, \"pullrequests\": {\"href\": \"https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo/pullrequests\"}}, \"fork_policy\": \"allow_forks\", \"uuid\": \"{def9ba25-9853-43a5-ae92-bf8ad89b38b7}\", \"language\": \"python\", \"created_on\": \"2016-03-21T19:39:20.064112+00:00\", \"mainbranch\": {\"type\": \"branch\", \"name\": \"master\"}, \"full_name\": \"guyzmo/git-repo\", \"has_issues\": false, \"owner\": {\"username\": \"guyzmo\", \"display_name\": \"Guyzmo\", \"type\": \"user\", \"uuid\": \"{abf29c83-e77e-4c9a-b5c7-38db801ef79e}\", \"links\": {\"self\": {\"href\": \"https://api.bitbucket.org/2.0/users/guyzmo\"}, \"html\": {\"href\": \"https://bitbucket.org/guyzmo/\"}, \"avatar\": {\"href\": \"https://bitbucket.org/account/guyzmo/avatar/32/\"}}}, \"updated_on\": \"2017-05-03T22:19:24.460574+00:00\", \"size\": 2521128, \"type\": \"repository\", \"slug\": \"git-repo\", \"is_private\": false, \"description\": \" Tool to manage multiple repository services from the git CLI\"}"
74+
},
75+
"headers": {
76+
"Connection": "keep-alive",
77+
"Content-Length": "1983",
78+
"Content-Type": "application/json; charset=utf-8",
79+
"Date": "Wed, 03 May 2017 23:17:10 GMT",
80+
"ETag": "\"12765c6a97df167d657de4f16eae7098\"",
81+
"Server": "nginx",
82+
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
83+
"Vary": "Authorization",
84+
"X-Accepted-OAuth-Scopes": "repository",
85+
"X-Content-Type-Options": "nosniff",
86+
"X-Frame-Options": "SAMEORIGIN",
87+
"X-OAuth-Scopes": "snippet:write, snippet, repository:delete, repository:admin, pullrequest:write, repository, project:write, project, team, account",
88+
"X-Render-Time": "0.0391199588776",
89+
"X-Request-Count": "448",
90+
"X-Served-By": "app-143",
91+
"X-Static-Version": "1c299938c525",
92+
"X-Version": "1c299938c525"
93+
},
94+
"status": {
95+
"code": 200,
96+
"message": "OK"
97+
},
98+
"url": "https://api.bitbucket.org/2.0/repositories/guyzmo/git-repo"
99+
}
50100
}
51101
],
52102
"recorded_with": "betamax/0.5.1"

tests/integration/cassettes/test_bitbucket_test_31_request_fetch__good.json

+119-21
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)