Exemple #1
0
def test_bats_001_check_user(sut_handle, user_info):
    manage = SysMgmt(sut_handle)

    # Get users
    users = manage.get_users()

    print("User check: {}".format(user_info))

    assert any((user["login"] == user_info["login"]) for user in users), "User not found."
Exemple #2
0
def test_bats_000_create_user(sut_handle, user_info):
    manage = SysMgmt(sut_handle)

    # Get existing users
    users = manage.get_users()

    if any((user["login"] == user_info["login"]) for user in users):
        # Skip creation (no-op), user already exist
        print("No-op, create user.")
    else:
        # Create user
        is_user_created = manage.create_user(user_info)

        assert is_user_created == True, "Not able to create the user."
Exemple #3
0
def test_bats_002_update_user(sut_handle, user_info):
    manage = SysMgmt(sut_handle)

    # Get existing users
    users = manage.get_users()

    # Check if user exist before proceeding from a list of users
    if any((user["login"] == user_info["login"]) for user in users):
        # User found, proceed with update
        is_user_updated = manage.update_user(user_info)

        assert is_user_updated == True, "Not able to udpate the user."
    else:
        # Skip update (no-op), user not found
        print("No-op, update user.")