From ec42b7a5f2333a286f0000810101d91437de5bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Ho=CC=88nicke?= Date: Tue, 2 May 2023 12:44:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA3=EF=B8=8F=E2=83=A3=20test:=20level?= =?UTF-8?q?=203=20fix=20no=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/options/generate/templates_user.py | 8 ++++---- test/test_generator.py | 13 ++++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/options/generate/templates_user.py b/src/options/generate/templates_user.py index 6b64638..d5c374b 100644 --- a/src/options/generate/templates_user.py +++ b/src/options/generate/templates_user.py @@ -138,7 +138,7 @@ template_generate_test = PromptTemplate.from_template( Write a single pytest case that tests the following scenario: '{test_description}'. In case the test scenario is not precise enough, test a general case without any assumptions. Start the test with an extensive comment about the test case. If gpt_3_5_turbo_api is used in the executor, then the test must not check the exact output of the executor as it is not deterministic. -Use the following import to import the function: +You must use the following import to import the function: ``` from .implementation import func ``` @@ -221,9 +221,9 @@ You are given the following files: {all_files_string} -Is this a PACKAGE_MANAGER dependency installation failure? -1. Write down one bullet point on why it could be a PACKAGE_MANAGER dependency installation failure. -2. Write down one bullet point on why it is unlikely that it is a PACKAGE_MANAGER dependency installation failure. +Is this error happening because a PACKAGE_MANAGER package is missing or failed to install? +1. Write down one bullet point on why the error might happen because a PACKAGE_MANAGER package is missing or failed to install. +2. Write down one bullet point on why it is unlikely that the error happens because a PACKAGE_MANAGER package is missing or failed to install. 3. Write down your final answer. 4. Write down your final answer as json in the following format: **response.json** diff --git a/test/test_generator.py b/test/test_generator.py index 29dbbea..fd9a19d 100644 --- a/test/test_generator.py +++ b/test/test_generator.py @@ -26,10 +26,6 @@ def test_generation_level_0(tmpdir): assert generator.generate() == 0 -# fixture -@pytest.fixture -def tmpdir(): - return 'microservice' def test_generation_level_1(tmpdir): @@ -97,9 +93,11 @@ data = {{ "url": "URL_OF_STORED_AUDIO_FILE" }} response = requests.post(url, headers=headers, data=data) -print(response.text) +assert response.status_code == 200 +print('This is the text from the audio file:', response.json()['text']) 2. Summarize the text (~50 words) while still maintaining the key facts. 3. Create an audio file of the summarized text using a tts library. +4. Return the the audio file. Example input file: https://www.signalogic.com/melp/EngSamples/Orig/ENG_M.wav ''', str(tmpdir) + 'microservice', @@ -147,5 +145,10 @@ Example input image: https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/P ) assert generator.generate() == 0 +@pytest.fixture +def tmpdir(): + return 'microservice' + + # further ideas: # Create a wrapper around google called Joogle. It modifies the page summary preview text of the search results to insert the word Jina as much as possible.