def test_index_with_multiple_nipsad_users(nipsa_api): nipsa_api.index.return_value = [ "acct:[email protected]", "acct:[email protected]", "acct:[email protected]"] assert nipsa.index(testing.DummyRequest()) == { "userids": ["kiki", "ursula", "osono"]}
def nipsa_index(_): return {"usernames": [util.user.split_user(u)["username"] for u in nipsa.index()]}
def test_index_with_no_nipsad_users(nipsa_api): nipsa_api.index.return_value = [] assert nipsa.index(testing.DummyRequest()) == {"userids": []}
def test_index_with_one_nipsad_users(nipsa_api): nipsa_api.index.return_value = ["acct:[email protected]"] assert nipsa.index(testing.DummyRequest()) == {"userids": ["kiki"]}
def nipsa_index(_): return { "usernames": [util.user.split_user(u)["username"] for u in nipsa.index()] }