| Conditions | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import json |
||
| 9 | def test_json_formatter(self): |
||
| 10 | name = 'name' |
||
| 11 | line = 42 |
||
| 12 | func = 'some_function' |
||
| 13 | |||
| 14 | log_record = LogRecord(name, INFO, func, line, 'sample log', None, None) |
||
| 15 | formatter = JSONFormatter() |
||
| 16 | |||
| 17 | log_result = formatter.format(log_record) |
||
| 18 | result = json.loads(log_result) |
||
| 19 | |||
| 20 | self.assertEqual(name, result['name']) |
||
| 21 | self.assertEqual(line, result['lineNumber']) |
||
| 22 | self.assertEqual(result) |
||
| 23 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.