8000 Cover RepoCommits. · jsullivanlive/github3.py@7bbc084 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7bbc084

Browse files
committed
Cover RepoCommits.
1 parent 40941e5 commit 7bbc084

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/test_repos.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,43 @@ def test_tarball_url(self):
442442

443443
def test_zipball_url(self):
444444
expect(self.tag.zipball_url).isinstance(base.str_test)
445+
446+
447+
class TestRepoCommit(base.BaseTest):
448+
def __init__(self, methodName='runTest'):
449+
super(TestRepoCommit, self).__init__(methodName)
450+
repo = self.g.repository(self.sigm, self.todo)
451+
self.commit = repo.commit('04d55444a3ec06ca8d2aa0a5e333cdaf27113254')
452+
self.sha = self.commit.sha
453+
454+
def test_additions(self):
455+
expect(self.commit.additions) == 12
456+
457+
def test_author(self):
458+
expect(self.commit.author).isinstance(User)
459+
460+
def test_commit(self):
461+
expect(self.commit.commit).isinstance(Commit)
462+
463+
def test_committer(self):
464+
expect(self.commit.committer).isinstance(User)
465+
466+
def test_deletions(self):
467+
expect(self.commit.deletions) == 5
468+
469+
def test_files(self):
470+
expect(self.commit.files).isinstance(list)
471+
expect(self.commit.files) > []
472+
for file in self.commit.files:
473+
expect(file.additions) > 0
474+
expect(file.deletions) > 0
475+
expect(file.changes) == file.additions + file.deletions
476+
expect(file.filename).isinstance(base.str_test)
477+
expect(file.blob_url).isinstance(base.str_test)
478+
expect(file.raw_url).isinstance(base.str_test)
479+
expect(file.sha) == self.sha
480+
expect(file.status) == 'modified'
481+
expect(file.patch).isinstance(base.str_test)
482+
483+
def test_total(self):
484+
expect(self.commit.total) == 17

0 commit comments

Comments
 (0)
0