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

Side by Side Diff: tools/telemetry/third_party/modulegraph/modulegraph_tests/test_explicit_packages.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
(Empty)
1 from __future__ import absolute_import
2 import unittest
3
4 import os, shutil, sys
5
6 from modulegraph import find_modules
7 from modulegraph import modulegraph
8
9
10 class PackagesTestCase (unittest.TestCase):
11 if not hasattr(unittest.TestCase, 'assertIsInstance'):
12 def assertIsInstance(self, object, types, message=None):
13 self.assertTrue(isinstance(object, types),
14 message or '%r is not an instance of %r'%(object, types))
15
16 def testIncludePackage(self):
17 root = os.path.join(
18 os.path.dirname(os.path.abspath(__file__)),
19 'testpkg-packages')
20
21 mf = find_modules.find_modules(
22 path=[root]+sys.path,
23 scripts=[os.path.join(root, "main_script.py")],
24 packages=['pkg'],
25 debug=1)
26
27 node = mf.findNode('pkg')
28 self.assertIsInstance(node, modulegraph.Package)
29
30 node = mf.findNode('pkg.sub3')
31 self.assertIsInstance(node, modulegraph.SourceModule)
32
33 def testIncludePackageWithExclude(self):
34 root = os.path.join(
35 os.path.dirname(os.path.abspath(__file__)),
36 'testpkg-packages')
37
38 mf = find_modules.find_modules(
39 path=[root]+sys.path,
40 scripts=[os.path.join(root, "main_script.py")],
41 packages=['pkg'],
42 excludes=['pkg.sub3'])
43
44 node = mf.findNode('pkg')
45 self.assertIsInstance(node, modulegraph.Package)
46
47 node = mf.findNode('pkg.sub3')
48 self.assertIsInstance(node, modulegraph.ExcludedModule)
49
50 if __name__ == '__main__':
51 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698