Skip to content

Commit b6c06ec

Browse files
committed
Added repository data tests.
1 parent 6a79f43 commit b6c06ec

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
status: 200
2+
x-ratelimit-remaining: 59
3+
content-location: https://github.com/api/v2/json/repos/show/JNRowe/misc-overlay
4+
x-runtime: 11ms
5+
content-length: 447
6+
server: nginx/0.7.67
7+
connection: keep-alive
8+
x-ratelimit-limit: 60
9+
etag: "977c6513db34b26e6084b833b45c7754"
10+
cache-control: private, max-age=0, must-revalidate
11+
date: Sun, 22 May 2011 07:50:08 GMT
12+
content-type: application/json; charset=utf-8
13+
14+
{"repository":{"homepage":"http://jnrowe.github.com/misc-overlay/","forks":0,"pushed_at":"2011/05/22 00:24:15 -0700","url":"https://github.com/JNRowe/misc-overlay","has_wiki":true,"watchers":5,"open_issues":6,"fork":false,"created_at":"2009/05/02 07:32:50 -0700","has_issues":true,"description":"Gentoo overlay -- miscellaneous packages","size":8449,"private":false,"name":"misc-overlay","owner":"JNRowe","language":"Python","has_downloads":true}}

tests/test_repositories.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import _setup
2+
3+
import datetime
4+
5+
from nose.tools import (assert_equals, assert_false, assert_true)
6+
7+
import utils
8+
9+
10+
class RepoProperties(utils.HttpMockTestCase):
11+
"""Test repository property handling"""
12+
def test_repo(self):
13+
repo = self.client.repos.show('JNRowe/misc-overlay')
14+
15+
assert_equals(repo.name, 'misc-overlay')
16+
assert_equals(repo.description,
17+
'Gentoo overlay -- miscellaneous packages')
18+
assert_equals(repo.url, 'https://github.com/JNRowe/misc-overlay')
19+
assert_equals(repo.owner, 'JNRowe')
20+
assert_equals(repo.homepage, 'http://jnrowe.github.com/misc-overlay/')
21+
22+
assert_equals(repo.project, 'JNRowe/misc-overlay')
23+
24+
def test_meta(self):
25+
repo = self.client.repos.show('JNRowe/misc-overlay')
26+
assert_equals(repo.forks, 0)
27+
assert_equals(repo.watchers, 5)
28+
assert_equals(repo.private, False)
29+
assert_equals(repo.fork, False)
30+
assert_equals(repo.master_branch, None)
31+
assert_equals(repo.integration_branch, None)
32+
assert_equals(repo.open_issues, 6)
33+
assert_equals(repo.created_at,
34+
datetime.datetime(2009, 5, 2, 7, 32, 50))
35+
assert_equals(repo.pushed_at,
36+
datetime.datetime(2011, 5, 22, 0, 24, 15))
37+
assert_equals(repo.has_downloads, True)
38+
assert_equals(repo.has_wiki, True)
39+
assert_equals(repo.has_issues, True)
40+
assert_equals(repo.language, 'Python')

0 commit comments

Comments
 (0)