def test_json_value_not_ok(self): self.params['key'] = '{"k": "v",}' value = ServiceCheck._json_value(self.params, 'key') self.assertIsNone(value)
def test_json_value_empty(self): self.params['key'] = '' value = ServiceCheck._json_value(self.params, 'key') self.assertIsNone(value)
def test_json_value_ok(self): self.params['key'] = '{"k": "v"}' value = ServiceCheck._json_value(self.params, 'key') self.assertIn('k', value) self.assertEqual(value['k'], 'v')