def test_get_user_details_google(mock_habitica_api_google): api = HabiticaApi(user_id=-1, api_token='uses_mok') user_details = api.get_user_details() assert default.JSON_ID in user_details assert default.JSON_NAME in user_details assert user_details[default.JSON_NAME] == utils.GOOGLE_NAME assert default.JSON_EMAIL in user_details assert user_details[default.JSON_EMAIL] == utils.USER_EMAIL
def test_get_user_details_facebook(mock_habitica_api_facebook): api = HabiticaApi(user_id=-1, api_token='uses_mok') user_details = api.get_user_details() assert default.JSON_ID in user_details assert default.JSON_NAME in user_details assert user_details[default.JSON_NAME] == utils.FACEBOOK_NAME assert default.JSON_EMAIL in user_details assert user_details[default.JSON_EMAIL] == utils.USER_EMAIL
def test_get_user_details_invalid_provider(mock_habitica_api_invalid_provider): api = HabiticaApi(user_id=-1, api_token='uses_mok') user_details = api.get_user_details() assert default.JSON_ID in user_details assert default.JSON_NAME not in user_details assert default.JSON_EMAIL not in user_details
def test_get_user_details_facebook(mock_habitica_api_facebook): api = HabiticaApi(user_id=-1, api_token='uses_mok') user_details = api.get_user_details() assert default.JSON_ID in user_details assert default.JSON_NAME in user_details assert user_details[default.JSON_NAME] == utils.FACEBOOK_NAME