diff --git a/lib/oc-tests/test_shareGroup.py b/lib/oc-tests/test_shareGroup.py index 19fbc9d..22afc84 100644 --- a/lib/oc-tests/test_shareGroup.py +++ b/lib/oc-tests/test_shareGroup.py @@ -82,13 +82,15 @@ def setup(step): step (1, 'create test users') - reset_owncloud_account(config.oc_number_test_users) + reset_owncloud_account(num_test_users=config.oc_number_test_users) check_users(num_test_users=config.oc_number_test_users) reset_owncloud_group(num_groups=config.oc_number_test_groups) check_groups(config.oc_number_test_groups) - add_user_to_group('user3', 'testgroup1') + user3 = "%s%i"%(config.oc_account_name, 3) + group1 = "%s%i"%(config.oc_group_name, 1) + add_user_to_group(user3, group1) reset_rundir() @@ -258,7 +260,10 @@ def admin(step): step (14, 'Admin user removes user from group') - remove_user_from_group('user3', 'testgroup1') + + user3 = "%s%i"%(config.oc_account_name, 3) + group1 = "%s%i"%(config.oc_group_name, 1) + remove_user_from_group(user3, group1) step (16, 'Admin final step') diff --git a/python/smashbox/utilities/__init__.py b/python/smashbox/utilities/__init__.py index fa01d72..5c4e921 100644 --- a/python/smashbox/utilities/__init__.py +++ b/python/smashbox/utilities/__init__.py @@ -37,11 +37,11 @@ def reset_owncloud_account(reset_procedure=None, num_test_users=None): logger.info('reset_owncloud_account (%s) for %d users', reset_procedure, num_test_users) if reset_procedure == 'delete': - if num_test_users is None: - delete_owncloud_account(config.oc_account_name) - create_owncloud_account(config.oc_account_name, config.oc_account_password) - login_owncloud_account(config.oc_account_name, config.oc_account_password) - else: + delete_owncloud_account(config.oc_account_name) + create_owncloud_account(config.oc_account_name, config.oc_account_password) + login_owncloud_account(config.oc_account_name, config.oc_account_password) + + if num_test_users is not None: for i in range(1, num_test_users + 1): username = "%s%i" % (config.oc_account_name, i) delete_owncloud_account(username)