| 1 |
"""Tests for the pdeps script in the Tools directory.""" |
| 2 |
|
| 3 |
import os |
| 4 |
import unittest |
| 5 |
import tempfile |
| 6 |
|
| 7 |
from test.test_tools import skip_if_missing, import_tool |
| 8 |
|
| 9 |
skip_if_missing() |
| 10 |
|
| 11 |
|
| 12 |
class PdepsTests(unittest.TestCase): |
| 13 |
|
| 14 |
@classmethod |
| 15 |
def setUpClass(self): |
| 16 |
self.pdeps = import_tool('pdeps') |
| 17 |
|
| 18 |
def test_process_errors(self): |
| 19 |
|
| 20 |
with tempfile.TemporaryDirectory() as tmpdir: |
| 21 |
fn = os.path.join(tmpdir, 'foo') |
| 22 |
with open(fn, 'w', encoding='utf-8') as stream: |
| 23 |
stream.write("#!/this/will/fail") |
| 24 |
self.pdeps.process(fn, {}) |
| 25 |
|
| 26 |
def test_inverse_attribute_error(self): |
| 27 |
|
| 28 |
self.pdeps.inverse({'a': []}) |
| 29 |
|
| 30 |
|
| 31 |
if __name__ == '__main__': |
| 32 |
unittest.main() |