Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pacifica/notifications/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,12 @@ class Root:
exposed = True
eventmatch = EventMatch()
receive = ReceiveEvent()

@staticmethod
@cherrypy.tools.json_out()
# pylint: disable=invalid-name
def GET():
"""Return happy message about functioning service."""
return {'message': 'Pacifica Notifications Up and Running'}
# pylint: enable=invalid-name
# pylint: enable=too-few-public-methods
9 changes: 9 additions & 0 deletions tests/eventmatch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
class EventMatchCPTest(NotificationsCPTest, helper.CPWebCase):
"""Test the EventMatch class."""

@eventmatch_droptables
def test_happy(self):
"""Test the create POST method in EventMatch."""
resp = requests.get('{}/'.format(self.url))
self.assertEqual(resp.status_code, 200)
self.assertTrue('Content-Type' in resp.headers)
self.assertEqual(resp.headers['Content-Type'], 'application/json')
self.assertTrue('message' in resp.json())

@eventmatch_droptables
def test_create(self):
"""Test the create POST method in EventMatch."""
Expand Down