Skip to content

Commit

Permalink
(hopefully) fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seidnerj committed Dec 5, 2024
1 parent af15e47 commit 3c661cd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ def test_get_body(self):
}
],
'stream': True,
'temperature': 1.0}))
'temperature': 1.0
}))

def test_get_body_without_stream(self):
model = 'gpt-4o'
Expand All @@ -432,7 +433,7 @@ def test_get_body_without_stream(self):
'content': 'test content'
}
],
'temperature': 1.0,
'temperature': 1.0
}))

@patch(module_name + '.openai.EbookTranslator')
Expand Down Expand Up @@ -584,7 +585,8 @@ def mock_get_body(text):
'messages': [
{'role': 'system', 'content': 'some prompt...'},
{'role': 'user', 'content': text}],
'temperature': 1.0})
'temperature': 1.0
})
self.mock_translator.get_body.side_effect = mock_get_body

file_id = self.batch_translator.upload(
Expand Down Expand Up @@ -853,12 +855,12 @@ def test_translate(self, mock_request, mock_et):
'URLs/addresses should be preserved as is in the translation\'s output. ')
data = json.dumps({
'stream': False,
'messages': [{'role': 'user', 'content': 'Hello World!'}],
'temperature': 1.0,
'model': model,
'max_tokens': 4096,
'model': model,
'top_k': 1,
'system': prompt
'system': prompt,
'messages': [{'role': 'user', 'content': 'Hello World!'}],
'temperature': 1.0
})
mock_et.__version__ = '1.0.0'
headers = {
Expand Down Expand Up @@ -918,7 +920,7 @@ def test_translate_stream(self, mock_request, mock_et):
'top_k': 1,
'system': prompt,
'messages': [{'role': 'user', 'content': 'Hello World!'}],
'temperature': 1.0,
'temperature': 1.0
})
mock_et.__version__ = '1.0.0'
headers = {
Expand Down

0 comments on commit 3c661cd

Please sign in to comment.