| Total Complexity | 11 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| 1 | # -*- coding: utf-8 -*- |
||
| 12 | class PathTests(TestCase): |
||
| 13 | |||
| 14 | @classmethod |
||
| 15 | def setUpClass(cls): |
||
| 16 | logz.set_root_level(logging.INFO) |
||
| 17 | logz.attach_stderr(logging.DEBUG) |
||
| 18 | assert not logz.attach_stderr() |
||
| 19 | |||
| 20 | @classmethod |
||
| 21 | def tearDownClass(self): |
||
| 22 | logz.detach_stderr() |
||
| 23 | assert not logz.detach_stderr() |
||
| 24 | |||
| 25 | def test_find_real_file(self): |
||
| 26 | fh = open_package_file('requirements/test.txt', None) |
||
| 27 | lines = fh.readlines() |
||
| 28 | fh.close() |
||
| 29 | assert any(line.startswith('testtools') for line in lines) |
||
| 30 | |||
| 31 | def test_find_python_file_in_package(self): |
||
| 32 | with PackageFile('path.py', 'auxlib') as fh: |
||
| 33 | lines = fh.readlines() |
||
| 34 | assert any(line.startswith(b'class PackageFile(object):') for line in lines) |
||
| 35 | |||
| 44 |