Skip to content

Commit 81ffe5c

Browse files
committed
test(main) remove unittest for prompt
1 parent cf7d6e6 commit 81ffe5c

3 files changed

Lines changed: 1 addition & 33 deletions

File tree

app/tests/test_iac_basic.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ def test_iac_basic_generation(mock_gpt_service, valid_iac_basic_data):
2424
response = client.post("/IaC-basic/", json=valid_iac_basic_data.model_dump())
2525
assert response.status_code == 200
2626
assert response.json() == {"output": mocked_gpt_response}
27-
28-
expected_prompt = """
29-
Write a robust answer about terraform, focusing on the latest update of terraform and based on this question:How do I manage state effectively in Terraform?,
30-
minimun length of answer is 100 and maximum length is 500
31-
"""
32-
actual_prompt = " ".join(mock_gpt_service.call_args[0][0].split())
33-
normalized_expected_prompt = " ".join(expected_prompt.split())
34-
assert actual_prompt == normalized_expected_prompt
35-
27+
3628
@patch('app.main.gpt_service')
3729
def test_basic_generation(mock_gpt_service):
3830
"""

app/tests/test_iac_bugfix.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,6 @@ def test_bugfix(mock_gpt_service, valid_bugfix_data):
2626
assert response.status_code == 200
2727
assert response.json() == {"output": mocked_gpt_response}
2828

29-
expected_prompt = """
30-
Write a clear answer to debug terraform
31-
focusing on the version latest of terraform and based on this bug:Application fails to start on version latest,
32-
generate a correct code that help us to solve this bug.
33-
minimum length of answer is 100 and maximum length is 500
34-
"""
35-
36-
37-
actual_prompt = " ".join(mock_gpt_service.call_args[0][0].split())
38-
normalized_expected_prompt = " ".join(expected_prompt.split())
39-
assert actual_prompt == normalized_expected_prompt
40-
41-
4229
@patch('app.main.gpt_service')
4330
def test_bugfix_invalid(mock_gpt_service):
4431
"""

app/tests/test_iac_install.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ def test_install(mock_gpt_service, valid_installation_data):
2323
response = client.post("/IaC-install/", json=valid_installation_data.model_dump())
2424
assert response.status_code == 200
2525
assert response.json() == {"output": mocked_gpt_response}
26-
expected_prompt = """
27-
generate a clear shell script about installation terraform in ubuntu based on terraform document.
28-
without any additional note. just script for installation. please consider new lines without any additional comment.
29-
"""
30-
actual_prompt = " ".join(mock_gpt_service.call_args[0][0].split()).strip()
31-
normalized_expected_prompt = " ".join(expected_prompt.split()).strip()
32-
if actual_prompt != normalized_expected_prompt:
33-
print("Expected Prompt:", repr(normalized_expected_prompt))
34-
print("Actual Prompt:", repr(actual_prompt))
35-
36-
assert actual_prompt == normalized_expected_prompt
3726

3827
@patch('app.main.gpt_service')
3928
def test_install_invalid(mock_gpt_service):

0 commit comments

Comments
 (0)