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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « tools/telemetry/telemetry/internal/testing/dependency_test_dir/dog/dog/dog_object.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import unittest 6 import unittest
7 7
8 from telemetry.core import util 8 from telemetry.core import util
9 from telemetry.internal.util import find_dependencies 9 from telemetry.internal.util import find_dependencies
10 10
11 11
12 class FindDependenciesTest(unittest.TestCase): 12 class FindDependenciesTest(unittest.TestCase):
13 def testFindPythonDependencies(self): 13 def testFindPythonDependencies(self):
14 dog_object_path = os.path.join( 14 dog_module_path = os.path.join(
15 util.GetUnittestDataDir(), 15 util.GetUnittestDataDir(),
16 'dependency_test_dir', 'dog', 'dog', 'dog_object.py') 16 'dependency_test_dir', 'dog', 'dog')
17 dog_object_path = os.path.join(dog_module_path, 'dog_object.py')
18 bone_module_path = os.path.join(dog_module_path, 'bone')
19 bone_module_init_path = os.path.join(bone_module_path, '__init__.py')
20 bone_object_path = os.path.join(bone_module_path, 'bone_object.py')
nednguyen 2015/09/22 15:11:41 Can you factor these extra tests to a different te
17 cat_module_path = os.path.join( 21 cat_module_path = os.path.join(
18 util.GetUnittestDataDir(), 22 util.GetUnittestDataDir(),
19 'dependency_test_dir', 'other_animals', 'cat', 'cat') 23 'dependency_test_dir', 'other_animals', 'cat', 'cat')
20 cat_module_init_path = os.path.join(cat_module_path, '__init__.py') 24 cat_module_init_path = os.path.join(cat_module_path, '__init__.py')
21 cat_object_path = os.path.join(cat_module_path, 'cat_object.py') 25 cat_object_path = os.path.join(cat_module_path, 'cat_object.py')
22 self.assertEquals( 26 self.assertEquals(
23 set(p for p in find_dependencies.FindPythonDependencies(dog_object_path)), 27 set(p for p in find_dependencies.FindPythonDependencies(dog_object_path)),
24 {dog_object_path, cat_module_path, cat_module_init_path, cat_object_path}) 28 {dog_object_path,
29 bone_module_path, bone_module_init_path, bone_object_path,
30 cat_module_path, cat_module_init_path, cat_object_path})
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/internal/testing/dependency_test_dir/dog/dog/dog_object.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698