| Total Complexity | 3 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| 1 | import sys |
||
| 11 | class PyCommentedCodeBearTest(LocalBearTestHelper): |
||
| 12 | def setUp(self): |
||
| 13 | self.uut = PyCommentedCodeBear(Section('name'), Queue()) |
||
| 14 | |||
| 15 | def test_valid(self): |
||
| 16 | self.assertLinesValid(self.uut, ["import sys"]) |
||
| 17 | self.assertLinesValid(self.uut, ["a = 1 + 1"]) |
||
| 18 | self.assertLinesValid(self.uut, ["# hey man!"]) |
||
| 19 | self.assertLinesValid(self.uut, ['"""', |
||
| 20 | 'Hey, this is a code sample:', |
||
| 21 | '>>> import os', |
||
| 22 | '', |
||
| 23 | 'And when you use it you can simply ' |
||
| 24 | 'do: `import os`.', |
||
| 25 | '"""']) |
||
| 26 | |||
| 27 | def test_invalid(self): |
||
| 28 | self.assertLinesInvalid(self.uut, ["# import os"]) |
||
| 29 | self.assertLinesInvalid(self.uut, ["# print('comment')"]) |
||
| 30 | |||
| 34 |