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

Side by Side Diff: tools/telemetry_tools/path_set_unittest.py

Issue 103433002: [telemetry] Script for finding all Telemetry dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove file for realz Created 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/telemetry_tools/path_set.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
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import unittest
8
9 import path_set
10
11
12 class PathSetTest(unittest.TestCase):
13 def testCreate(self):
14 ps = path_set.PathSet()
15 self.assertEqual(len(ps), 0)
16 self.assertFalse(__file__ in ps)
17 for path in ps:
18 self.fail('New set is not empty.')
19
20 ps = path_set.PathSet([__file__])
21 self.assertEqual(len(ps), 1)
22 self.assertTrue(__file__ in ps)
23 self.assertEqual(ps.pop(), os.path.realpath(__file__))
24
25 def testAdd(self):
26 ps = path_set.PathSet()
27 ps.add(__file__)
28 self.assertEqual(len(ps), 1)
29 self.assertTrue(__file__ in ps)
30 self.assertEqual(ps.pop(), os.path.realpath(__file__))
31
32 def testDiscard(self):
33 ps = path_set.PathSet([__file__])
34 ps.discard(__file__)
35 self.assertEqual(len(ps), 0)
36 self.assertFalse(__file__ in ps)
37
38
39 if __name__ == '__main__':
40 unittest.main()
OLDNEW
« no previous file with comments | « tools/telemetry_tools/path_set.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698