Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
Issue: #10
Implementation:
Report:
Create a new test file
Created a new test file 'test_dispatch_to_qa.py' in the 'test/' directory. The file currently contains import statements for the necessary modules and placeholders for the setup function and the test functions.Import necessary modules and define setup
Created a new test file 'test_dispatch_to_qa.py' in the 'test/' directory. The file currently contains import statements for the necessary modules and placeholders for the setup function and the test functions. The setup function prepares the necessary data for the tests, and the test functions test the 'prep_request_payload', 'send_to_qa', and 'send_to_qa_async' functions in the 'dispatch_to_qa.py' file.Define test function for 'prep_request_payload'
Implemented the test function for 'prep_request_payload'. It calls 'prep_request_payload' with the mock data from the setup and checks the returned 'qna_endpoint' and 'qna_data'.Define test function for 'send_to_qa'
Implemented the test function for 'send_to_qa' in the 'test_dispatch_to_qa.py' file. The function uses the 'requests_mock' module to mock a POST request to 'mock_qna_endpoint' that returns a 200 status code and a JSON response or a response content chunk, a 500 status code, or raises an exception. It then calls 'send_to_qa' with the mock data and checks that the returned value is as expected.Define test function for 'send_to_qa_async'
Implemented the test function for 'send_to_qa_async' in the 'test_dispatch_to_qa.py' file. The function uses the 'aiohttp' module to mock a POST request to 'mock_qna_endpoint' that returns a 200 status code and a JSON response, a 500 status code, or raises an exception. It then calls 'send_to_qa_async' with the mock data and checks that the returned value is as expected.Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #10. Then, add the
ellipsis:create
label to try again. For more information, check the documentation.