def test_GetCurrentUserWithLogin(capsys): loggedin() am = AuthManager("target", dbn) x = am.getCurrentUser() out, err = capsys.readouterr() assert out.strip() == "Current user is: %s, email: %s" % (TestUser, TestEmail) assert type(x) == type({}) assert x["name"] == TestUser
def test_GetCurrentUserWhthoutLogin(capsys): am = AuthManager("target", dbn) x = am.getCurrentUser() out, err = capsys.readouterr() assert out.strip() == "There is no default user."