Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

avoiding validation error when heartbeats are received

  • Loading branch information...
commit 646afa30f3dd67ee2dbdb234c7b7dda76419b12f 1 parent 615f092
@mriehl mriehl authored
View
3  src/main/python/yadtreceiver/events.py
@@ -38,7 +38,8 @@
TYPE_FULL_UPDATE = 'full-update'
TYPE_REQUEST = 'request'
TYPE_SERVICE_CHANGE = 'service-change'
-KNOWN_EVENT_TYPES = [TYPE_COMMAND, TYPE_FULL_UPDATE, TYPE_REQUEST, TYPE_SERVICE_CHANGE]
+TYPE_HEARTBEAT = 'heartbeat'
+KNOWN_EVENT_TYPES = [TYPE_COMMAND, TYPE_FULL_UPDATE, TYPE_REQUEST, TYPE_SERVICE_CHANGE, TYPE_HEARTBEAT]
class IncompleteEventDataException(Exception):
View
8 src/unittest/python/event_tests.py
@@ -64,6 +64,14 @@ def test_should_return_description_of_multiple_service_changes(self):
})
self.assertEqual(str(event), 'target[target-name] services changed: spam is up, eggs is down')
+ def test_should_not_complain_upon_receiving_heartbeat_events(self):
+ event = Event('target-name', {'id': 'heartbeat',
+ 'type': 'event',
+ 'target': 'dev12',
+ 'tracking_id': None,
+ 'payload': None})
+
+
def test_should_return_description_of_request(self):
event = Event('target-name', {'id': 'request',
'cmd': 'command',
Please sign in to comment.
Something went wrong with that request. Please try again.