blob: 27cbfe215d039d4e935871b146c49b11be09fa13 [file] [log] [blame]
Zachary Ware2b0a6102014-07-16 14:26:09 -05001"""Tests for the pdeps script in the Tools directory."""
2
3import os
Zachary Ware2b0a6102014-07-16 14:26:09 -05004import unittest
5import tempfile
Zachary Ware2b0a6102014-07-16 14:26:09 -05006
Serhiy Storchakae437a102016-04-24 21:41:02 +03007from test.test_tools import skip_if_missing, import_tool
Zachary Ware2b0a6102014-07-16 14:26:09 -05008
9skip_if_missing()
10
11
12class PdepsTests(unittest.TestCase):
13
14 @classmethod
15 def setUpClass(self):
16 self.pdeps = import_tool('pdeps')
17
18 def test_process_errors(self):
19 # Issue #14492: m_import.match(line) can be None.
20 with tempfile.TemporaryDirectory() as tmpdir:
21 fn = os.path.join(tmpdir, 'foo')
22 with open(fn, 'w') as stream:
23 stream.write("#!/this/will/fail")
24 self.pdeps.process(fn, {})
25
26 def test_inverse_attribute_error(self):
27 # Issue #14492: this used to fail with an AttributeError.
28 self.pdeps.inverse({'a': []})
29
30
31if __name__ == '__main__':
32 unittest.main()