1
1
import os
2
+
2
3
import pytest
4
+
3
5
from gptscript .command import (
4
6
version ,
5
7
list_models ,
@@ -118,16 +120,16 @@ def test_stream_exec_complex_tool(complex_tool):
118
120
out , err , wait = stream_exec (complex_tool )
119
121
resp = wait () # Wait for streaming to complete
120
122
assert (
121
- out is not None or err is not None
123
+ out is not None or err is not None
122
124
), "Expected some output or error from stream_exec using complex_tool"
123
125
assert (
124
- resp == 0
126
+ resp == 0
125
127
), "Expected a successful response from stream_exec using complex_tool"
126
128
127
129
128
130
def test_exec_file_with_chdir ():
129
- # By changing the directory here, we should be able to find the test.gpt file without `./test `
130
- out , err = exec_file ("./test.gpt" , opts = {"chdir" : "./fixtures" })
131
+ # By changing the directory here, we should be able to find the test.gpt file without `./tests `
132
+ out , err = exec_file ("./test.gpt" , opts = {"chdir" : "./tests/ fixtures" })
131
133
for line in out :
132
134
print (line )
133
135
for line in err :
@@ -139,14 +141,14 @@ def test_exec_file_with_chdir():
139
141
140
142
# Test streaming execution from a file
141
143
def test_stream_exec_file ():
142
- out , err , wait = stream_exec_file ("./fixtures/test.gpt" )
144
+ out , err , wait = stream_exec_file ("./tests/ fixtures/test.gpt" )
143
145
resp = wait () # Wait for streaming to complete
144
146
for line in out :
145
147
print (line )
146
148
for line in err :
147
149
print (line )
148
150
assert (
149
- out is not None or err is not None
151
+ out is not None or err is not None
150
152
), "Expected some output or error from stream_exec_file"
151
153
assert resp == 0 , "Expected a successful response from stream_exec_file"
152
154
@@ -166,7 +168,7 @@ def test_stream_exec_tool_with_events(simple_tool):
166
168
167
169
168
170
def test_stream_exec_file_with_events ():
169
- out , err , events , wait = stream_exec_file_with_events ("./fixtures/test.gpt" )
171
+ out , err , events , wait = stream_exec_file_with_events ("./tests/ fixtures/test.gpt" )
170
172
has_events = False
171
173
for line in events :
172
174
has_events = line != ""
0 commit comments