@pytest.mark.gen_test
def test_graph_disable(session, graph, groups, http_client, base_url):  # noqa
    groupname = u'serving-team'

    graph.update_from_db(session)
    old_groups = graph.groups
    assert sorted(old_groups) == sorted(groups.keys())
    assert groupname in graph.permission_metadata

    # disable a group
    fe_url = url(base_url, '/groups/{}/disable'.format(groupname))
    resp = yield http_client.fetch(fe_url, method="POST",
            headers={"X-Grouper-User": "zorkian@a.co"}, body=urlencode({"name": groupname}))
    assert resp.code == 200

    graph.update_from_db(session)
    assert len(graph.groups) == (len(old_groups) - 1), 'disabled group removed from graph'
    assert groupname not in graph.groups
    assert groupname not in graph.permission_metadata
Test that disabled groups work with the graph as expected.
dataset/ETHPy150Open dropbox/grouper/tests/test_groups.py/test_graph_disable