|
1 | 1 | import os |
2 | | -import json |
| 2 | +import json as json_mod |
3 | 3 | try: |
4 | 4 | from mock import patch |
5 | 5 | except ImportError: # nocv |
@@ -34,7 +34,7 @@ def check_output_run(self, check_data, *args, **kwargs): |
34 | 34 | rep += self.recipients[self.count] |
35 | 35 | self.assertEqual(check_data[0], rep) |
36 | 36 | self.assertEqual(check_data[1], 'on_execution') |
37 | | - message = json.loads(kwargs['input']) |
| 37 | + message = json_mod.loads(kwargs['input']) |
38 | 38 | self.assertEqual(message.get('test', None), 'test') |
39 | 39 | self.assertTrue(kwargs['universal_newlines']) |
40 | 40 | self.count += 1 |
@@ -64,12 +64,12 @@ def test_script(self): |
64 | 64 | self.assertEqual(hook.run(message=dict(test="test")), "Err\nErr") |
65 | 65 | self.assertEqual(cmd.call_count, 4) |
66 | 66 |
|
67 | | - def check_output_run_http(self, method, url, data, **kwargs): |
| 67 | + def check_output_run_http(self, method, url, data=None, json=None, **kwargs): |
68 | 68 | # pylint: disable=protected-access, unused-argument |
69 | 69 | self.assertEqual(method, "post") |
70 | 70 | self.check_output_run( |
71 | | - [url, data['type']], |
72 | | - cwd='', input=json.dumps(data['payload']), |
| 71 | + [url, json['type']], |
| 72 | + cwd='', input=json_mod.dumps(json['payload']), |
73 | 73 | universal_newlines=True |
74 | 74 | ) |
75 | 75 | the_response = Response() |
|
0 commit comments