Skip to content

Commit

Permalink
Adds test for env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
edgararuiz committed Apr 10, 2024
1 parent 86c1681 commit 9266a4f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/testthat/_snaps/chattr-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,33 @@
Output
[1] "OpenAI - Chat Completions - gpt-4 (gpt4) \n"

# Menu works

Code
chattr_defaults(force = TRUE)
Message
-- chattr ----------------------------------------------------------------------
-- Defaults for: Default --
-- Prompt:
* Use the R language, the tidyverse, and tidymodels
-- Model
* Provider: LlamaGPT
* Path/URL: ~/LlamaGPTJ-chat/build/bin/chat
* Model: test/path
* Label: GPT4ALL 1.3 (LlamaGPT)
-- Model Arguments:
* threads: 4
* temp: 0.01
* n_predict: 1000
-- Context:
Max Data Files: 0
Max Data Frames: 0
x Chat History
x Document contents

11 changes: 11 additions & 0 deletions tests/testthat/test-chattr-use.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ test_that("Menu works", {
}
)
})


test_that("Menu works", {
withr::with_envvar(
new = c(
"CHATTR_USE" = "llamagpt",
"CHATTR_MODEL" = "test/path"
),
expect_snapshot(chattr_defaults(force = TRUE))
)
})

0 comments on commit 9266a4f

Please sign in to comment.