File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export OPENAI_API_KEY=<your-key>
3030
3131``` python
3232# content of tests/test_weather.py
33+ import invariant.testing.functional as F
3334from invariant.testing import Trace, assert_equals
3435
3536def test_weather ():
@@ -47,7 +48,7 @@ def test_weather():
4748 locations = trace.messages()[- 1 ][" content" ].extract(" locations" )
4849
4950 # assert that the agent responded about Paris and only Paris
50- assert_equals(1 , locations .len(),
51+ assert_equals(1 , F .len(locations ),
5152 " The agent should respond about one location only" )
5253
5354 assert_equals(" Paris" , locations[0 ], " The agent should respond about Paris" )
@@ -63,7 +64,7 @@ ERROR: 1 hard assertions failed:
6364
6465
6566 # assert that the agent responded about Paris and only Paris
66- assert_equals(1 , locations .len(),
67+ assert_equals(1 , F .len(locations ),
6768 " The agent should respond about one location only" )
6869
6970> assert_equals(" Paris" , locations[0 ], " The agent should respond about Paris" )
You can’t perform that action at this time.
0 commit comments