Skip to content

Commit 6ed355a

Browse files
committed
fix: use separate gptscript file for cred override on Windows
Signed-off-by: Donnie Adams <donnie@acorn.io>
1 parent 2182e11 commit 6ed355a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
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 powershell.exe
4+
5+
echo "$env:TEST_CRED"

tests/test_gptscript.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def complex_tool():
6262
@pytest.fixture
6363
def tool_list():
6464
shebang = "#!/bin/bash"
65-
if platform.system() == "windows":
65+
if platform.system().lower() == "windows":
6666
shebang = "#!/usr/bin/env powershell.exe"
6767
return [
6868
ToolDef(tools=["echo"], instructions="echo 'hello there'"),
@@ -185,8 +185,11 @@ async def collect_events(run: Run, e: CallFrame | RunFrame | PromptFrame):
185185

186186
@pytest.mark.asyncio
187187
async def test_credential_override(gptscript):
188+
gptscriptFile = "credential-override.gpt"
189+
if platform.system().lower() == "windows":
190+
gptscriptFile = "credential-override-windows.gpt"
188191
run = gptscript.run(
189-
os.getcwd() + "/tests/fixtures/credential-override.gpt",
192+
f"{os.getcwd()}{os.sep}fixtures{os.sep}{gptscriptFile}",
190193
Options(
191194
disableCache=True,
192195
credentialOverrides=['test.ts.credential_override:TEST_CRED=foo']

0 commit comments

Comments
 (0)