| Total Complexity | 3 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import unittest |
||
| 12 | class TestObjectReprFormatters(unittest.TestCase): |
||
| 13 | def setUp(self): |
||
| 14 | self.obj = Klass('hello', 10) |
||
| 15 | self.attributes = ['z', 'y'] |
||
| 16 | |||
| 17 | def test_format_repr(self): |
||
| 18 | result = format_repr(self.obj, self.attributes) |
||
| 19 | expected = "Klass(z='hello', y=10)" |
||
| 20 | |||
| 21 | self.assertEqual(expected, result) |
||
| 22 | |||
| 23 | def test_format_repr_info(self): |
||
| 24 | result = format_repr_info(self.obj, self.attributes) |
||
| 25 | expected = "<Klass(z='hello', y=10)>" |
||
| 26 | |||
| 27 | self.assertEqual(expected, result) |
||
| 28 |
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.