Skip to content

Commit

Permalink
links updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fopina committed Jan 26, 2016
1 parent 343bb51 commit 7163193
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 99 deletions.
14 changes: 10 additions & 4 deletions pushitbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ def token(self, message, text):
return self.bot.return_message(message.chat.id, '''\
You can use the following token to access the HTTP API:
*%s*
*%(token)s*
Please send /help command if you have any problem''' % token, parse_mode='Markdown')
Your API URL: https://tgbots-fopina.rhcloud.com/pushit/%(token)s
Your WebPush URL: http://fopina.github.io/tgbot-pushitbot/webpush/#%(token)s
Please send /help command if you have any problem''' % {'token': token}, parse_mode='Markdown')

def revoke(self, message, text):
token = self._new_token(message.chat.id)
Expand All @@ -35,9 +38,12 @@ def revoke(self, message, text):
Your _old_ token has been revoked.
You can now use the following token to access the HTTP API:
*%s*
*%(token)s*
Your API URL: https://tgbots-fopina.rhcloud.com/pushit/%(token)s
Your WebPush URL: http://fopina.github.io/tgbot-pushitbot/webpush/#%(token)s
Please send /help command if you have any problem''' % token, parse_mode='Markdown')
Please send /help command if you have any problem''' % {'token': token}, parse_mode='Markdown')

def help(self, message, text):
return self.bot.return_message(message.chat.id, u'''\
Expand Down
16 changes: 11 additions & 5 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def setUp(self):
self.webapp = TestApp(pushitbot.extend_webapp(wsgi_app([self.bot]), self.bot))

def test_ping(self):
self.assertEqual(self.webapp.get('/ping/').text, '<b>Pong!</b>')
self.assertEqual(self.webapp.get('/ping/').text, '<b>Pong!</b>')

def test_chat(self):
self.receive_message('invalid')
Expand All @@ -32,9 +32,12 @@ def test_token(self):
self.assertReplied('''\
You can use the following token to access the HTTP API:
*%s*
*%(token)s*
Please send /help command if you have any problem''' % token)
Your API URL: https://tgbots-fopina.rhcloud.com/pushit/%(token)s
Your WebPush URL: http://fopina.github.io/tgbot-pushitbot/webpush/#%(token)s
Please send /help command if you have any problem''' % {'token': token})

return token

Expand All @@ -49,9 +52,12 @@ def test_revoke(self):
Your _old_ token has been revoked.
You can now use the following token to access the HTTP API:
*%s*
*%(token)s*
Your API URL: https://tgbots-fopina.rhcloud.com/pushit/%(token)s
Your WebPush URL: http://fopina.github.io/tgbot-pushitbot/webpush/#%(token)s
Please send /help command if you have any problem''' % token2)
Please send /help command if you have any problem''' % {'token': token2})

def test_notify_invalid_token(self):
res = self.webapp.post_json('/pushit/123', params={'msg': 'hello'})
Expand Down
90 changes: 0 additions & 90 deletions webpush.html

This file was deleted.

0 comments on commit 7163193

Please sign in to comment.