aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2016-09-15 17:44:39 +0300
committerkongr45gpen <electrovesta@gmail.com>2016-09-15 17:44:39 +0300
commitb3830d9ff1ccfd3ad3515e15bbf843d4bea0da80 (patch)
treee6fe58b0711071106963292719cf7286819326ef
parent420453c38d2dbca742f0b2b041b989355ace9c80 (diff)
downloadsupybot_github-b3830d9ff1ccfd3ad3515e15bbf843d4bea0da80.tar.gz
supybot_github-b3830d9ff1ccfd3ad3515e15bbf843d4bea0da80.tar.bz2
supybot_github-b3830d9ff1ccfd3ad3515e15bbf843d4bea0da80.zip
Add tests for issues and pull requests
-rw-r--r--test.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/test.py b/test.py
index 413c5c4..7c455a6 100644
--- a/test.py
+++ b/test.py
@@ -128,6 +128,60 @@ class GithubTestCase(ExpectationPluginTestCase):
it().should.contain('https://github.com/baxterthehacker/public-repo/branches')
)
+ def testIssueCreate(self):
+ self.sendRequest('issue-create')
+
+ self.describe('first message',
+ it().should.contain('kongr45gpen'),
+ it().should.contain('test'),
+ it().should.contain('opened'),
+ it().should.contain('Another issue'),
+ it().should.contain('#6'),
+ it().should_not.contain('pull request'),
+ it().should.contain('https://github.com/kongr45gpen/test/issues/6')
+ )
+
+ def testIssueComment(self):
+ self.sendRequest('issue-comment')
+
+ self.describe('first message',
+ it().should.contain('kongr45gpen'),
+ it().should.contain('test'),
+ it().should.contain('commented'),
+ it().should.contain('Another issue'),
+ it().should.contain('#6'),
+ it().should_not.contain('pull request'),
+ it().should.contain('https://github.com/kongr45gpen/test/issues/6#issuecomment-181134370')
+ )
+
+ def testPullRequestCreate(self):
+ self.sendRequest('pr-create')
+
+ self.describe('first message',
+ it().should.contain('baxterthehacker'),
+ it().should.contain('public-repo'),
+ it().should.contain('opened'),
+ it().should.contain('Update the README with new information'),
+ it().should.contain('#1'),
+ it().should.contain('pull request'),
+ it().should_not.contain('issue'),
+ it().should.contain('https://github.com/baxterthehacker/public-repo/pull/1')
+ )
+
+ def testPullRequestComment(self):
+ self.sendRequest('pr-comment')
+
+ self.describe('first message',
+ it().should.contain('kongr45gpen'),
+ it().should.contain('test'),
+ it().should.contain('commented'),
+ it().should.contain('Update README.md'),
+ it().should.contain('#7'),
+ it().should.contain('pull request'),
+ it().should_not.contain('commented on issue'),
+ it().should.contain('https://github.com/kongr45gpen/test/pull/7#issuecomment-247345280')
+ )
+
def testRelease(self):
self.sendRequest('release')

© 2014-2024 Faster IT GmbH | imprint | privacy policy