Skip to content

Commit

Permalink
Merge pull request #25 from owncloud/shareGroup-test-does-not-reset-a…
Browse files Browse the repository at this point in the history
…ccounts-correctly

Share group test does not reset accounts correctly
  • Loading branch information
moscicki committed Jun 19, 2015
2 parents bf1d6cd + 2acea27 commit 14ae119
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions lib/oc-tests/test_shareGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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')

10 changes: 5 additions & 5 deletions python/smashbox/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 14ae119

Please sign in to comment.