From 6f58f38748085e6a104de6f9e992469d3b685d5a Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 7 Jan 2011 11:17:55 -0500 Subject: Display the entries that failed when deleting with --continue. We collected the failures but didn't report it back. This changes the API of most delete commands so rather than returning a boolean it returns a dict with the only current key as failed. This also adds a new parameter flag, suppress_empty. This will try to not print values that are empty if included. This makes the output of the delete commands a bit prettier. ticket 687 --- tests/test_xmlrpc/test_automount_plugin.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'tests/test_xmlrpc/test_automount_plugin.py') diff --git a/tests/test_xmlrpc/test_automount_plugin.py b/tests/test_xmlrpc/test_automount_plugin.py index e793a454a..92c695d42 100644 --- a/tests/test_xmlrpc/test_automount_plugin.py +++ b/tests/test_xmlrpc/test_automount_plugin.py @@ -147,7 +147,8 @@ class test_automount(XMLRPC_test): """ delkey_kw={'automountkey': self.keyname, 'raw': True} res = api.Command['automountkey_del'](self.locname, self.mapname, **delkey_kw)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verify that it is gone try: @@ -162,7 +163,8 @@ class test_automount(XMLRPC_test): Test the `xmlrpc.automountlocation_del` method. """ res = api.Command['automountlocation_del'](self.locname)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verify that it is gone try: @@ -227,7 +229,8 @@ class test_automount_indirect(XMLRPC_test): """ delkey_kw = {'automountkey': self.keyname} res = api.Command['automountkey_del'](self.locname, self.parentmap, **delkey_kw)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verify that it is gone try: @@ -242,7 +245,8 @@ class test_automount_indirect(XMLRPC_test): Remove the indirect map for auto.home. """ res = api.Command['automountmap_del'](self.locname, self.mapname)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verify that it is gone try: @@ -257,7 +261,8 @@ class test_automount_indirect(XMLRPC_test): Remove the location. """ res = api.Command['automountlocation_del'](self.locname)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verity that it is gone try: @@ -310,7 +315,8 @@ class test_automount_indirect_no_parent(XMLRPC_test): """ delkey_kw={'automountkey': self.keyname} res = api.Command['automountkey_del'](self.locname, self.parentmap, **delkey_kw)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verify that it is gone try: @@ -325,7 +331,8 @@ class test_automount_indirect_no_parent(XMLRPC_test): Remove the indirect map for auto.home. """ res = api.Command['automountmap_del'](self.locname, self.mapname)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verify that it is gone try: @@ -340,7 +347,8 @@ class test_automount_indirect_no_parent(XMLRPC_test): Remove the location. """ res = api.Command['automountlocation_del'](self.locname)['result'] - assert res == True + assert res + assert_attr_equal(res, 'failed', '') # Verity that it is gone try: -- cgit