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

Unified Diff: tests/watchlists_unittest.py

Issue 392006: Cleanup the unit tests by mocking more system functions. (Closed)
Patch Set: Created 11 years, 1 month 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 | « tests/trychange_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/watchlists_unittest.py
diff --git a/tests/watchlists_unittest.py b/tests/watchlists_unittest.py
index 968de038f83999f6a700ca4183824762a568633f..22afe2feb5c5e6938ac546644ac59c1ef8030e65 100755
--- a/tests/watchlists_unittest.py
+++ b/tests/watchlists_unittest.py
@@ -5,8 +5,6 @@
"""Unit tests for watchlists.py."""
-import os
-import unittest
import super_mox
import watchlists
@@ -142,8 +140,8 @@ class WatchlistsTest(super_mox.SuperMoxTestBase):
'browser': %s,
},
} """ % watchers
- saved_sep = os.sep
- os.sep = '\\' # to pose as win32
+ saved_sep = watchlists.os.sep
+ watchlists.os.sep = '\\' # to pose as win32
watchlists.Watchlists._HasWatchlistsFile().AndReturn(True)
watchlists.Watchlists._ContentsOfWatchlistsFile().AndReturn(contents)
self.mox.ReplayAll()
@@ -151,9 +149,10 @@ class WatchlistsTest(super_mox.SuperMoxTestBase):
wl = watchlists.Watchlists(r'a\path')
returned_watchers = wl.GetWatchersForPaths(
[r'chrome\browser\renderer_host\render_widget_host.h'])
- os.sep = saved_sep # revert back os.sep before asserts
+ watchlists.os.sep = saved_sep # revert back os.sep before asserts
self.assertEqual(returned_watchers, watchers)
if __name__ == '__main__':
+ import unittest
unittest.main()
« no previous file with comments | « tests/trychange_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698