Example #1
0
 def test_update_one_message(self):
     """
     Test called with one message
     """
     healthcheck = {
         'messages': [{
             'status': 'status'
         }],
         'category': 'category',
         'id': 'id'
     }
     service = MagicMock()
     _update(service, healthcheck)
     service.state.set.assert_called_once_with('category', 'id', 'status')
Example #2
0
 def test_update_multiple_messages(self):
     """
     Test called with one message
     """
     healthcheck = {
         'messages': [{
             'status': 'status',
             'id': 1
         }, {
             'status': 'status',
             'id': 2
         }],
         'category':
         'category',
         'id':
         'id'
     }
     service = MagicMock()
     _update(service, healthcheck)
     service.state.set.assert_has_calls([
         call('category', 'id-1', 'status'),
         call('category', 'id-2', 'status')
     ])