diff options
author | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-09-18 19:34:50 +0000 |
---|---|---|
committer | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-09-18 19:34:50 +0000 |
commit | bb397dcd2faa5d756aa7b39f5568a288b0cd87e9 (patch) | |
tree | 582f956c9602463ed65759db3f163bbb560ee049 /cli | |
parent | c2b3b2c5f44dd265935d0576849bd7a87afb0bcc (diff) |
A few followup enhancements to the recent change made to the cli to enclose the topic names in single quotes.
Signed-off-by: Ashwin Ganti <aganti@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@3747 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'cli')
-rwxr-xr-x | cli/action_common.py | 3 | ||||
-rwxr-xr-x | cli/action_common_unittest.py | 10 | ||||
-rwxr-xr-x | cli/job_unittest.py | 11 |
3 files changed, 13 insertions, 11 deletions
diff --git a/cli/action_common.py b/cli/action_common.py index 0776dc1d..b6e7a4e8 100755 --- a/cli/action_common.py +++ b/cli/action_common.py @@ -262,9 +262,8 @@ class atest_add_or_remove(topic_common.atest): def output(self, results): for thing, single_thing in self.add_remove_things.iteritems(): - things_ok = results[thing] # Enclose each of the elements in a single quote. - things_ok = ["'%s'" % t for t in things_ok] + things_ok = ["'%s'" % t for t in results[thing]] if things_ok: self.print_wrapped("%s %s %s %s" % (self.msg_done, self.msg_topic, diff --git a/cli/action_common_unittest.py b/cli/action_common_unittest.py index 40d4468d..6aec9261 100755 --- a/cli/action_common_unittest.py +++ b/cli/action_common_unittest.py @@ -403,16 +403,16 @@ class atest_add_or_remove_unittest(cli_mock.cli_unittest): def test_execute_add_or_remove_uh_to_topic_acl_good_users_bad_hosts(self): - acl_addrm = self._create_add_remove('acl0', + acl_addrm = self._create_add_remove('acl0 with space', users=['user0', 'user1'], hosts=['host0', 'host1']) self.mock_rpcs([('acl_group_add_users', - {'id': 'acl0', + {'id': 'acl0 with space', 'users': ['user0', 'user1']}, True, None), ('acl_group_add_hosts', - {'id': 'acl0', + {'id': 'acl0 with space', 'hosts': ['host0', 'host1']}, False, 'DoesNotExist: The following hosts do not exist: ' @@ -420,10 +420,10 @@ class atest_add_or_remove_unittest(cli_mock.cli_unittest): execute_result = acl_addrm.execute() self.god.check_playback() - self.assertEqual(['acl0'], execute_result['users']) + self.assertEqual(['acl0 with space'], execute_result['users']) self.assertEqual([], execute_result['hosts']) self.assertOutput(acl_addrm, execute_result, - out_words_ok=["Added to ACL 'acl0' users:", + out_words_ok=["Added to ACL 'acl0 with space' users:", "user0", "user1"], err_words_ok=['DoesNotExist', 'acl_group_add_hosts', diff --git a/cli/job_unittest.py b/cli/job_unittest.py index 0714fc75..4e572cd6 100755 --- a/cli/job_unittest.py +++ b/cli/job_unittest.py @@ -735,10 +735,13 @@ class job_create_unittest(cli_mock.cli_unittest): 'is_server' : False, 'dependencies' : []}), ('create_job', data, True, 180)], - # This is actually 8 spaces, - # the tab has been converted by print. - out_words_ok=["test job with spaces", "Created", - "id", "180"]) + # This is actually 7 spaces, the extra single quote that + # gets displayed before "test" causes the tab completion + # to move to the next 8 char boundary which is 7 characters + # away. Hence the 7 spaces in out_words_ok. + # The tab has been converted by print. + out_words_ok=['test job with spaces', 'Created', + 'id', '180']) def test_execute_create_job_no_args(self): |