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

Unified Diff: client/bin/job_unittest.py

Issue 6246035: Merge remote branch 'cros/upstream' into master (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 11 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
« cli/job.py ('K') | « client/bin/job.py ('k') | client/bin/kernel.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/bin/job_unittest.py
diff --git a/client/bin/job_unittest.py b/client/bin/job_unittest.py
index 24c0501241bd6a389e933381063a17047c4d985e..0e5aedeebc74491d8700ad4e243c65e31650b0c2 100755
--- a/client/bin/job_unittest.py
+++ b/client/bin/job_unittest.py
@@ -18,7 +18,7 @@ class job_test_case(unittest.TestCase):
job_class = job.base_client_job
def setUp(self):
- self.god = mock.mock_god()
+ self.god = mock.mock_god(ut=self)
self.god.stub_with(job.base_client_job, '_get_environ_autodir',
classmethod(lambda cls: '/adir'))
self.job = self.job_class.__new__(self.job_class)
@@ -86,6 +86,7 @@ class test_init_minimal_options(abstract_test_init, job_test_case):
user = None
log = False
args = ''
+ tap_report = None
self.god.stub_function_to_return(job.utils, 'drop_caches', None)
self.job._job_state = base_job_unittest.stub_job_state
@@ -109,7 +110,7 @@ class first_line_comparator(mock.argument_comparator):
class test_base_job(unittest.TestCase):
def setUp(self):
# make god
- self.god = mock.mock_god()
+ self.god = mock.mock_god(ut=self)
# need to set some environ variables
self.autodir = "autodir"
@@ -241,6 +242,7 @@ class test_base_job(unittest.TestCase):
options.hostname = 'localhost'
options.user = 'my_user'
options.args = ''
+ options.tap_report = None
self.job.__init__(self.control, options,
extra_copy_cmdline=['more-blah'])
@@ -280,6 +282,7 @@ class test_base_job(unittest.TestCase):
options.hostname = 'localhost'
options.user = 'my_user'
options.args = ''
+ options.tap_report = None
error = Exception('fail')
self.god.stub_function(self.job, '_post_record_init')
@@ -691,5 +694,18 @@ class test_base_job(unittest.TestCase):
self.god.check_playback()
+ def test_parse_args(self):
+ test_set = {"a='foo bar baz' b='moo apt'":
+ ["a='foo bar baz'", "b='moo apt'"],
+ "a='foo bar baz' only=gah":
+ ["a='foo bar baz'", "only=gah"],
+ "a='b c d' no=argh":
+ ["a='b c d'", "no=argh"]}
+ for t in test_set:
+ parsed_args = job.base_client_job._parse_args(t)
+ expected_args = test_set[t]
+ self.assertEqual(parsed_args, expected_args)
+
+
if __name__ == "__main__":
unittest.main()
« cli/job.py ('K') | « client/bin/job.py ('k') | client/bin/kernel.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698