Index: tools/telemetry/telemetry/internal/util/find_dependencies_unittest.py |
diff --git a/tools/telemetry/telemetry/internal/util/find_dependencies_unittest.py b/tools/telemetry/telemetry/internal/util/find_dependencies_unittest.py |
index 8afd21c78e0cb9b65fc49e5565157a058fb7604a..7d43915e042c00021da0a414770a870764ec1781 100644 |
--- a/tools/telemetry/telemetry/internal/util/find_dependencies_unittest.py |
+++ b/tools/telemetry/telemetry/internal/util/find_dependencies_unittest.py |
@@ -22,3 +22,17 @@ class FindDependenciesTest(unittest.TestCase): |
self.assertEquals( |
set(p for p in find_dependencies.FindPythonDependencies(dog_object_path)), |
{dog_object_path, cat_module_path, cat_module_init_path, cat_object_path}) |
+ |
+ def testFindPythonDependenciesWithNestedImport(self): |
+ moose_module_path = os.path.join( |
+ util.GetUnittestDataDir(), |
+ 'dependency_test_dir', 'other_animals', 'moose', 'moose') |
+ moose_object_path = os.path.join(moose_module_path, 'moose_object.py') |
+ horn_module_path = os.path.join(moose_module_path, 'horn') |
+ horn_module_init_path = os.path.join(horn_module_path, '__init__.py') |
+ horn_object_path = os.path.join(horn_module_path, 'horn_object.py') |
+ self.assertEquals( |
+ set(p for p in |
+ find_dependencies.FindPythonDependencies(moose_object_path)), |
+ {moose_object_path, |
+ horn_module_path, horn_module_init_path, horn_object_path}) |