summaryrefslogtreecommitdiffstats
path: root/SCons/Node/FSTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'SCons/Node/FSTests.py')
-rw-r--r--SCons/Node/FSTests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/SCons/Node/FSTests.py b/SCons/Node/FSTests.py
index e2eb0af..e50f721 100644
--- a/SCons/Node/FSTests.py
+++ b/SCons/Node/FSTests.py
@@ -4046,6 +4046,23 @@ class AbsolutePathTestCase(unittest.TestCase):
os.chdir(save_cwd)
+class PyPackageDir(unittest.TestCase):
+ def runTest(self) -> None:
+ """Test calling the PyPackageDir() method.
+
+ We don't want to mock the positive case here - there's
+ testing for that in E2E test test/Dir/PyPackageDir.
+ We're only making sure we don't die in the negative case
+ (module not found) and instead return None.
+ """
+ fs = SCons.Node.FS.FS('/')
+ try:
+ pkdir = fs.PyPackageDir("garglemod")
+ except AttributeError:
+ self.fail("non-existent module raised AttributeError")
+ self.assertIsNone(pkdir)
+
+
if __name__ == "__main__":
unittest.main()