Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1261)

Unified Diff: tools/telemetry/telemetry/internal/util/find_dependencies_unittest.py

Issue 1347283006: Extend unittest to test follow-module behavior of find_dependencies.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separate test method Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/internal/testing/dependency_test_dir/other_animals/moose/moose/moose_object.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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})
« no previous file with comments | « tools/telemetry/telemetry/internal/testing/dependency_test_dir/other_animals/moose/moose/moose_object.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698