Skip to content

Commit d46f7d6

Browse files
committed
test: add credential override test
Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com>
1 parent 4345db0 commit d46f7d6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
credentials: github.com/gptscript-ai/credential as test.ts.credential_override with TEST_CRED as env
2+
3+
#!/usr/bin/env bash
4+
5+
echo "${TEST_CRED}"

tests/test_gptscript.py

+10
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,16 @@ async def collect_events(run: Run, e: CallFrame | RunFrame | PromptFrame):
183183
assert "Ronald Reagan" in await run.text(), "Expect streaming file to have correct output"
184184
assert "Ronald Reagan" in stream_output, "Expect stream_output to have correct output when streaming from file"
185185

186+
@pytest.mark.asyncio
187+
async def test_credential_override(gptscript):
188+
run = gptscript.run(
189+
"./tests/fixtures/credential-override.gpt",
190+
Options(
191+
disableCache=True,
192+
credentialOverride='test.ts.credential_override:TEST_CRED=foo'
193+
),
194+
)
195+
assert "foo" in await run.text(), "Expect credential override to have correct output"
186196

187197
@pytest.mark.asyncio
188198
async def test_eval_with_context(gptscript):

0 commit comments

Comments
 (0)