Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ellipsis] Agent tests #16

Merged
merged 2 commits into from Mar 10, 2024
Merged

Conversation

ellipsis-dev[bot]
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot commented Mar 10, 2024

Summary:

⚠️ We couldn't build/test your project to verify our changes. Add a Dockerfile to significantly improve code quality.

Issue: #15

Implementation:

  1. Create a new test file for config.py
    • Create a new file in the test folder named test_config.py. This file will contain all the tests for the functions in config.py. Use the unittest module to structure your tests. Start by importing the necessary modules and creating a new test case class.
  2. Create tests for fetch_config function
    • In the test_config.py file, create a test for the fetch_config function. Use the unittest.mock module to create a mock Google Cloud Storage bucket and blob. Test that the function correctly fetches the blob and returns the updated time. Also, test the case where the blob does not exist and the function should return None.
  3. Create tests for get_module_filepath function
    • In the test_config.py file, create a test for the get_module_filepath function. Create a mock file and test that the function correctly returns the full file path of the mock file. Also, test the case where the file does not exist and the function should raise an error.
  4. Create tests for load_config function
    • In the test_config.py file, create a test for the load_config function. Create a mock configuration file and test that the function correctly loads the file. Also, test the case where the file does not exist and the function should raise an error. Additionally, test the case where the environment variable is not set and the function should raise an error.
  5. Create tests for load_config_key function
    • In the test_config.py file, create a test for the load_config_key function. Create a mock configuration file and test that the function correctly loads a specific key from the file. Also, test the case where the key does not exist in the configuration file and the function should raise an error.

Report:

Step Result Details
1
Create a new test file for config.pyCreated a new test file 'test_config.py' in the '/sunholo/tests/' directory. The file currently imports the necessary modules and has a test case class named 'TestConfig'.
2
Create tests for fetch_config functionAdded a test for the fetch_config function in the test_config.py file. The test uses mock objects to simulate a Google Cloud Storage bucket and blob, and tests that the function correctly fetches the blob and returns the updated time. It also tests the case where the blob does not exist and the function should return None.
3
Create tests for get_module_filepath functionAdded a test for the get_module_filepath function in the test_config.py file. The test uses a mock file and tests that the function correctly returns the full file path of the mock file. It also tests the case where the file does not exist and the function should raise an error.
4
Create tests for load_config functionAdded a test for the load_config function in the test_config.py file. The test uses a mock configuration file and tests that the function correctly loads the file. It also tests the cases where the file does not exist and the environment variable is not set.
5
Create tests for load_config_key functionAdded a test for the load_config_key function in the test_config.py file. The test uses a mock configuration file and tests that the function correctly loads a specific key from the file. It also tests the case where the key does not exist in the configuration file and the function should raise an error.

Something look wrong?: If this Pull Request doesn't contain the expected changes, add more information to #15. Then, add the ellipsis:create label to try again. For more information, check the documentation.

@MarkEdmondson1234
Copy link
Contributor

@ellipsis-dev please adjust to use pytest

Copy link
Contributor Author

ellipsis-dev bot commented Mar 10, 2024

@MarkEdmondson1234, I have addressed your comments in commit fb03b21

@MarkEdmondson1234 MarkEdmondson1234 merged commit fa41262 into main Mar 10, 2024
@MarkEdmondson1234 MarkEdmondson1234 deleted the ellipsis/wflow_QAywLpmRFf5wsY25_bTLo branch March 10, 2024 13:53
@nsbradford nsbradford mentioned this pull request Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant