|
1 | 1 | import os
|
2 | 2 | import platform
|
| 3 | +import subprocess |
3 | 4 |
|
4 | 5 | import pytest
|
5 | 6 |
|
6 | 7 | from gptscript.confirm import AuthResponse
|
7 | 8 | from gptscript.frame import RunEventType, CallFrame, RunFrame, RunState, PromptFrame
|
8 | 9 | from gptscript.gptscript import GPTScript
|
| 10 | +from gptscript.install import install, gptscript_binary_name, python_bin_dir |
9 | 11 | from gptscript.opts import GlobalOptions, Options
|
10 | 12 | from gptscript.prompt import PromptResponse
|
11 | 13 | from gptscript.run import Run
|
@@ -77,6 +79,13 @@ def tool_list():
|
77 | 79 | ]
|
78 | 80 |
|
79 | 81 |
|
| 82 | +def test_install(): |
| 83 | + install() |
| 84 | + bin_name = str(python_bin_dir / gptscript_binary_name) |
| 85 | + process = subprocess.Popen([bin_name, '-v'], stdout=subprocess.PIPE, text=True) |
| 86 | + assert process.stdout.read().startswith('gptscript version ') |
| 87 | + |
| 88 | + |
80 | 89 | @pytest.mark.asyncio
|
81 | 90 | async def test_create_another_gptscript():
|
82 | 91 | g = GPTScript()
|
@@ -427,8 +436,8 @@ async def process_event(r: Run, frame: CallFrame | RunFrame | PromptFrame):
|
427 | 436 | ).text()
|
428 | 437 |
|
429 | 438 | assert confirm_event_found, "No confirm event"
|
430 |
| - assert "authorization error" in out, "Unexpected output: " + out |
431 |
| - assert "authorization error" in event_content, "Unexpected event output: " + event_content |
| 439 | + assert "unable to list" in out, "Unexpected output: " + out |
| 440 | + assert "unable to list" in event_content, "Unexpected event output: " + event_content |
432 | 441 |
|
433 | 442 |
|
434 | 443 | @pytest.mark.asyncio
|
|
0 commit comments