class RFile():
def read(self, content_length):
- return post_data
+ return json.dumps(post_data, sort_keys=True)
class MockNotifierHandler(NotifierHandler):
self.handler.do_POST()
set_head.assert_called_once()
- notify.assert_called_with(json.dumps(post_data))
+ notify.assert_called_with(post_data)
- @mock.patch.object(KafkaProducer, "notify_alarm")
+ @mock.patch.object(KafkaProducer, "publish_alarm_response")
@mock.patch.object(DatabaseManager, "get_alarm")
def test_notify_alarm_valid_alarm(
self, get_alarm, notify):
notify.assert_called_with("notify_alarm", mock.ANY)
- @mock.patch.object(KafkaProducer, "notify_alarm")
+ @mock.patch.object(KafkaProducer, "publish_alarm_response")
@mock.patch.object(DatabaseManager, "get_alarm")
def test_notify_alarm_invalid_alarm(
self, get_alarm, notify):