|
| 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