def test_graph_cycle_indirect(session, graph, users, groups):  # noqa

    add_member(groups["team-sre"], users["gary@a.co"])
    add_member(groups["tech-ops"], users["zay@a.co"])
    add_member(groups["team-infra"], users["testuser@a.co"])

    add_member(groups["team-sre"], groups["tech-ops"])
    add_member(groups["tech-ops"], groups["team-infra"])
    add_member(groups["team-infra"], groups["all-teams"])

    add_member(groups["all-teams"], groups["team-sre"])

    session.commit()
    graph.update_from_db(session)
    all_users = set(["gary@a.co", "zay@a.co", "testuser@a.co"])
    all_groups = set(["team-sre", "all-teams", "tech-ops", "team-infra"])

    assert get_users(graph, "team-sre") == all_users
    assert get_users(graph, "team-sre", cutoff=1) == set(["gary@a.co"])

    assert get_users(graph, "tech-ops") == all_users
    assert get_users(graph, "tech-ops", cutoff=1) == set(["zay@a.co"])

    assert get_users(graph, "team-infra") == all_users
    assert get_users(graph, "team-infra", cutoff=1) == set(["testuser@a.co"])

    assert get_users(graph, "all-teams") == all_users
    assert get_users(graph, "all-teams", cutoff=1) == set([])

    assert get_groups(graph, "gary@a.co") == all_groups
    assert get_groups(graph, "gary@a.co", cutoff=1) == set(["team-sre"])

    assert get_groups(graph, "zay@a.co") == all_groups
    assert get_groups(graph, "zay@a.co", cutoff=1) == set(["tech-ops"])

    assert get_groups(graph, "testuser@a.co") == all_groups
    assert get_groups(graph, "testuser@a.co", cutoff=1) == set(["team-infra"])
Initialize cmd line args
dataset/ETHPy150Open dropbox/grouper/tests/test_groups.py/test_graph_cycle_indirect--crossover with--dataset/ETHPy150Open spotify/luigi/luigi/cmdline_parser.py/CmdlineParser.__init__