diff --git a/IntegrationTest.py b/IntegrationTest.py index b8f5098b..60ee418e 100644 --- a/IntegrationTest.py +++ b/IntegrationTest.py @@ -197,6 +197,18 @@ class IntegrationTest: assert not r.has_in_collaborators( cobaye ) self.printList( "Collaborators", r.get_collaborators(), lambda m: m.login ) + def testCommentCommit( self ): + r = self.g.get_user().get_repo( "TestPyGithub" ) + c = r.get_commits()[ 0 ] + self.printList( "Comments", c.get_comments(), lambda c: c.body ) + com1 = c.create_comment( "Comment created by PyGithub" ) + self.printList( "Comments", c.get_comments(), lambda c: c.body ) + com2 = c.create_comment( "Comment also created by PyGithub", path = "ReadMe.md", line = 1 ) + self.printList( "Comments", c.get_comments(), lambda c: c.body ) + com2.delete() + com1.edit( body = "Comment edited by PyGithub" ) + self.printList( "Comments", c.get_comments(), lambda c: c.body ) + def testCreateForkForOrganization( self ): o = self.g.get_organization( self.cobayeOrganization ) r = self.g.get_user().get_repo( "TestPyGithub" ) diff --git a/github/GithubObjects.py b/github/GithubObjects.py index 723ded55..e3c9806f 100644 --- a/github/GithubObjects.py +++ b/github/GithubObjects.py @@ -297,8 +297,8 @@ Commit = GithubObject( InternalObjectAttribute( "author", NamedUser ), InternalObjectAttribute( "committer", NamedUser ), ExternalListOfObjects( "comments", "comment", CommitComment, - ListGetable( [], [] ), - ElementCreatable( [ "body", "commit_id", "line", "path", "position" ], [] ), + ListGetable( [], [], __modifyAttributesForObjectsReferingReferedRepo ), + ElementCreatable( [ "body" ], [ "commit_id", "line", "path", "position" ], __modifyAttributesForObjectsReferingReferedRepo ), ), )