<packageNotFoundError/error/condition>
Error in `loadNamespace(name)`: there is no package called 'huggingfaceR'

# Mock functions that depend on an active python environment
virtualenv_create = function(envname, ...) test$created_env <- envname,
virtualenv_install = function(env_name, packages, ...) test$installed_packages <- packages,
py_config = function(...) list(virtualenv = "/Users/User/.virtualenvs/iscores"),
hf_load_pipeline = function(pipeline_name, ...) pipeline_name,
test_that("configure_python correctly steps through setup process", {
expect_setequal(test$installed_packages, c("spacy", "transformers", "torch", "sentencepiece"))
test_that("configure_python correctly errors if Python is already bound to another environment", {
py_config = function(...) list(virtualenv = "/Users/User/.virtualenvs/not_iscores"),
expect_error(configure_python(), "Python is already bound to the 'not_iscores' environment. Please restart R and try again.")
test_that("configure_python correctly errors if ManifestoBERTA model cannot be loaded", {
hf_load_pipeline = function(pipeline_name, ...) stop("Could not load model"),
expect_error(configure_python(), "Could not load the specified ManifestoBERTA model. Ensure the model ID exists and Hugging Face is accessible.")

"configure_python correctly steps through setup process"
"configure_python correctly errors if Python is already bound to another environment"
"Python is already bound to the 'not_iscores' environment. Please restart R and try again."
"configure_python correctly errors if ManifestoBERTA model cannot be loaded"
"Could not load the specified ManifestoBERTA model. Ensure the model ID exists and Hugging Face is accessible."

configure_python correctly steps through setup process

configure_python correctly errors if Python is already bound to another environment

configure_python correctly errors if ManifestoBERTA model cannot be loaded