Skip to content

Commit

Permalink
test get_tag() against GitHub output
Browse files Browse the repository at this point in the history
  • Loading branch information
cvrebert committed Dec 17, 2013
1 parent ada2aa8 commit 0fcf9f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions restfulgit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def _convert_repo(repo_key):
"url": url_for('.get_repo', _external=True, repo_key=repo_key)
}


def _convert_signature(sig):
return {
"name": sig.name,
Expand Down
17 changes: 9 additions & 8 deletions tests/test_restfulgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,24 +572,25 @@ def test_get_binary_blob_works(self):
pass

def test_get_tag_works(self):
# From https://api.github.com/repos/hulu/restfulgit/git/tags/1dffc031c9beda43ff94c526cbc00a30d231c079 with necessary adjustments
resp = self.client.get('/repos/restfulgit/git/tags/{}/'.format(TAG_FOR_FIRST_COMMIT))
self.assert200(resp)
self.assertEqual(
resp.json,
{
"sha": "1dffc031c9beda43ff94c526cbc00a30d231c079",
"url": "http://localhost/repos/restfulgit/git/tags/1dffc031c9beda43ff94c526cbc00a30d231c079/",
"tagger": {
"name": "Chris Rebert",
"email": "chris.rebert@hulu.com",
"date": "2013-09-28T01:14:09Z"
},
"object": {
"url": "http://localhost/repos/restfulgit/git/commits/07b9bf1540305153ceeb4519a50b588c35a35464/",
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464",
"type": "commit"
"type": "commit",
"url": "http://localhost/repos/restfulgit/git/commits/07b9bf1540305153ceeb4519a50b588c35a35464/"
},
"sha": "1dffc031c9beda43ff94c526cbc00a30d231c079",
"tag": "initial",
"tagger": {
"date": "2013-09-28T01:14:09Z",
"name": "Chris Rebert",
"email": "chris.rebert@hulu.com"
},
"message": "initial commit\n"
}
)
Expand Down

0 comments on commit 0fcf9f7

Please sign in to comment.