From ec801bbfbb3272a55cd5ad041fc94a9c7d2ff797 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Sun, 7 May 2017 14:58:56 +0300 Subject: Add a netlify test --- local/handler/NetlifyHandler.py | 2 +- local/theme/DefaultTheme.py | 4 ++-- test.py | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/local/handler/NetlifyHandler.py b/local/handler/NetlifyHandler.py index daa802f..614e067 100644 --- a/local/handler/NetlifyHandler.py +++ b/local/handler/NetlifyHandler.py @@ -9,5 +9,5 @@ def handle(data, theme): commitId = data['commit_ref'], commitMessage = data['title'], commitAuthor = data['commit_url'].split('/')[3], #TODO: Make this show the proper author - url = getShortURL(data['url']) + url = getShortURL(data['deploy_url']) ) diff --git a/local/theme/DefaultTheme.py b/local/theme/DefaultTheme.py index 096311c..4215f51 100644 --- a/local/theme/DefaultTheme.py +++ b/local/theme/DefaultTheme.py @@ -162,7 +162,7 @@ class DefaultTheme(Theme): )) def deployment(self, branch, repo, status, commitId, commitMessage, commitAuthor, url): - self.msgs.append( "%s @ %s: Deployment status: %s * %s by %s %s") % ( + self.msgs.append( "%s @ %s: Deployment status: %s * %s by %s %s" % ( ircutils.bold(ircutils.mircColor(branch, "blue")), ircutils.bold(repo), colorAction(status.lower()), @@ -172,7 +172,7 @@ class DefaultTheme(Theme): ircutils.mircColor(maxLen(commitMessage, 50), "dark gray"), url )) - ) + )) def status(self, status, description, url): self.msgs.append( "%s: %s - %s %s" % ( diff --git a/test.py b/test.py index f711595..9300ca6 100644 --- a/test.py +++ b/test.py @@ -122,6 +122,16 @@ class GithubTestCase(ExpectationPluginTestCase): self.assertError('get second message') + def testNetlify(self): + self.sendRequest('netlify-ready') + + self.describe('first message', + it().should.contain('master @ bzflag-plugin-starter'), + it().should.contain('ready'), + it().should.contain('19a67'), + it().should.contain('iisgood') + ) + def testCreateTag(self): self.sendRequest('create-tag') -- cgit v1.2.3