fixed tests

pull/190/head
Nicholas Albion 3 years ago
parent 671afb0118
commit 498ddca27a

@ -54,12 +54,12 @@ class TestCodeMonkey:
convo = MagicMock()
mock_responses = [
# [],
[{
{'files': [{
'content': 'Washington',
'description': "A new .txt file with the word 'Washington' in it.",
'name': 'washington.txt',
'path': 'washington.txt'
}]
}]}
]
convo.send_message.side_effect = mock_responses
@ -94,12 +94,12 @@ class TestCodeMonkey:
convo = MagicMock()
mock_responses = [
# ['file_to_read.txt', 'output.txt'],
[{
{'files': [{
'content': 'Hello World!\n',
'description': 'This file is the output file. The content of file_to_read.txt is copied into this file.',
'name': 'output.txt',
'path': 'output.txt'
}]
}]}
]
convo.send_message.side_effect = mock_responses

@ -23,7 +23,7 @@ class TestFunctionCalling:
response = parse_agent_response(response, function_calls)
# Then
assert response == 'Hello world!'
assert response == {'greeting': 'Hello world!'}
def test_parse_agent_response_json_markdown(self):
# Given
@ -35,7 +35,7 @@ class TestFunctionCalling:
response = parse_agent_response(response, function_calls)
# Then
assert response == 'Hello world!'
assert response == {'greeting': 'Hello world!'}
def test_parse_agent_response_markdown(self):
# Given
@ -47,7 +47,7 @@ class TestFunctionCalling:
response = parse_agent_response(response, function_calls)
# Then
assert response == 'Hello world!'
assert response == {'greeting': 'Hello world!'}
def test_parse_agent_response_multiple_args(self):
# Given
@ -55,11 +55,11 @@ class TestFunctionCalling:
function_calls = {'definitions': [], 'functions': {}}
# When
greeting, name = parse_agent_response(response, function_calls)
response = parse_agent_response(response, function_calls)
# Then
assert greeting == 'Hello'
assert name == 'John'
assert response['greeting'] == 'Hello'
assert response['name'] == 'John'
def test_json_prompter():

Loading…
Cancel
Save