def METHOD_NAME(oauth_provider_var_mock):
    with mock.patch("oauth2.oauth2.OAuth2Session") as MockOAuth2Session:
        oauth2.refresh(FAKE_OAUTH_PROVIDER)
        # A token was refreshed
        MockOAuth2Session.return_value.refresh_token.assert_called_once()
        # Tokens were updated
        assert oauth_provider_var_mock.set.call_args.args[0] == oauth2.OAUTH2_TOKEN_KEY