Skip to content

Commit

Permalink
Add basic integration tests util.group
Browse files Browse the repository at this point in the history
  • Loading branch information
stsnel committed Aug 1, 2024
1 parent ea74e66 commit b657ac0
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import data_access_token
import folder
import schema
from util import avu, collection, config, constants, data_object, log, msi, resource, rule, user
from util import avu, collection, config, constants, data_object, group, log, msi, resource, rule, user


def _call_msvc_stat_vault(ctx, resc_name, data_path):
Expand Down Expand Up @@ -470,6 +470,27 @@ def _test_folder_secure_func(ctx, func):
{"name": "util.data_object.get_group_owners",
"test": lambda ctx: data_object.get_group_owners(ctx, "/tempZone/home/research-initial/testdata/lorem.txt"),
"check": lambda x: x == [['research-initial', 'tempZone']]},
{"name": "util.group.exists.yes",
"test": lambda ctx: group.exists(ctx, "research-initial"),
"check": lambda x: x},
{"name": "util.group.exists.no",
"test": lambda ctx: group.exists(ctx, "research-doesnotexist"),
"check": lambda x: not x},
{"name": "util.group.get_category",
"test": lambda ctx: group.get_category(ctx, "research-initial"),
"check": lambda x: x == "test-automation"},
{"name": "util.group.is_member.yes",
"test": lambda ctx: group.is_member(ctx, "research-initial", "researcher"),
"check": lambda x: x},
{"name": "util.group.is_member.no",
"test": lambda ctx: group.is_member(ctx, "research-initial", "rods"),
"check": lambda x: not x},
{"name": "util.group.members.normal",
"test": lambda ctx: group.members(ctx, "research-initial"),
"check": lambda x: sorted([member for member in x]) == sorted([('functionaladminpriv', 'tempZone'), ('[email protected]', 'tempZone'), ('groupmanager', 'tempZone'), ('[email protected]', 'tempZone'), ('researcher', 'tempZone'), ('[email protected]', 'tempZone')])},
{"name": "util.group.members.doesnotexist",
"test": lambda ctx: user.exists(ctx, "research-doesnotexist"),
"check": lambda x: x is False},
{"name": "util.resource.exists.yes",
"test": lambda ctx: resource.exists(ctx, "irodsResc"),
"check": lambda x: x},
Expand Down

0 comments on commit b657ac0

Please sign in to comment.