refactor: summarize error message without line number

This commit is contained in:
Florian Hönicke
2023-06-06 14:59:59 +02:00
parent a01a2ecdd3
commit 7b10f16f6c

View File

@@ -119,33 +119,33 @@ Example input: 'AAPL'
) )
assert generator.generate() == 0 assert generator.generate() == 0
#
@pytest.mark.parametrize( # @pytest.mark.parametrize(
'mock_input_sequence', [ # 'mock_input_sequence', [
[ # [
'y', # 'y',
'https://www2.cs.uic.edu/~i101/SoundFiles/taunt.wav', # 'https://www2.cs.uic.edu/~i101/SoundFiles/taunt.wav',
f'''\ # f'''\
import requests # import requests
url = "https://transcribe.whisperapi.com" # url = "https://transcribe.whisperapi.com"
headers = {{ # headers = {{
'Authorization': 'Bearer {os.environ['WHISPER_API_KEY']}' # 'Authorization': 'Bearer {os.environ['WHISPER_API_KEY']}'
}} # }}
data = {{ # data = {{
"url": "URL_OF_STORED_AUDIO_FILE" # "url": "URL_OF_STORED_AUDIO_FILE"
}} # }}
response = requests.post(url, headers=headers, data=data) # response = requests.post(url, headers=headers, data=data)
assert response.status_code == 200 # assert response.status_code == 200
print('This is the text from the audio file:', response.text)''', # print('This is the text from the audio file:', response.text)''',
'use any library', # 'use any library',
# f'''\ # # f'''\
# import openai # # import openai
# audio_file= open("/path/to/file/audio.mp3", "rb") # # audio_file= open("/path/to/file/audio.mp3", "rb")
# transcript = openai.Audio.transcribe("whisper-1", audio_file)''' # # transcript = openai.Audio.transcribe("whisper-1", audio_file)'''
] # ]
], # ],
indirect=True # indirect=True
) # )
# def test_generation_level_4(microservice_dir, mock_input_sequence): # def test_generation_level_4(microservice_dir, mock_input_sequence):
# """ # """
# Requirements: # Requirements: