Skip to content

allignment #363

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

Closed
wants to merge 29 commits into from
Closed

allignment #363

wants to merge 29 commits into from

Conversation

VinciGit00
Copy link
Collaborator

No description provided.

Ikko Eltociear Ashimine and others added 28 commits June 5, 2024 16:04
## [1.5.5](v1.5.4...v1.5.5) (2024-06-05)

### Bug Fixes

* bug on generate_answer_node ([1d38ed1](1d38ed1))

### Docs

* add Japanese README ([4559ab6](4559ab6))
* update japanese.md ([f0042a8](f0042a8))
* update README.md ([871e398](871e398))
## [1.5.6](v1.5.5...v1.5.6) (2024-06-05)

### Bug Fixes

* getter ([67d83cf](67d83cf))
add the Ernie context window
- Changed the access of model_name from dictionary-style to attribute-style in llm_model
to comply with langchain BaseChatModel.
- Updated the conditional and split operations accordingly.
## [1.5.7](v1.5.6...v1.5.7) (2024-06-06)

### Bug Fixes

* update openai tts class ([10672d6](10672d6))
This commit enhances the test suite for the JSON scraping pipeline by introducing the following improvements:

- Separate configuration from the test code by loading it from a JSON file (config.json)
- Use a parametrized fixture to run the test with multiple configurations automatically
- Read the sample JSON file from a separate inputs directory for better organization
- Add explicit assertions to verify the expected output (list of titles)
- Improve test organization and separation of concerns using fixtures
- Promote better coding practices and make the test suite more extensible

These changes aim to improve the testability, maintainability, and flexibility of the test suite. They make it easier to manage configurations, add or modify test cases, and ensure the robustness of the scraping pipeline. The test suite now follows best practices and is better prepared for future changes and requirements.
test: Enhance JSON scraping pipeline test
This commit enhances the test suite for the FetchNode class by introducing mocking for the execute method using the unittest.mock module.

Changes:
- Imported the patch and MagicMock classes from unittest.mock.
- Decorated each test function with @patch('scrapegraphai.nodes.FetchNode.execute') to mock the execute method.
- Set the return_value of the mocked execute method to a MagicMock instance.
- Added assertions to check if the mocked execute method was called with the expected state dictionary.
- Updated the test functions to use the mocked execute method instead of the actual implementation.

Benefits:
- Improved test reliability by isolating the FetchNode class from external dependencies.
- Faster test execution since external resources (e.g., URLs, files) are not required.
- Better test coverage by testing the execute method's behavior with various input states.
- Increased maintainability by decoupling tests from the implementation details of the execute method.

The functionality of the FetchNode class remains unchanged, but the tests now use mocking to ensure the correct behavior of the execute method without relying on external resources or dependencies.
This commit enhances the test suite for the ScriptCreatorGraph class by improving code readability, adding more informative assertions, and printing the prettified execution information.

Changes:
- Added more descriptive docstrings for better code documentation.
- Improved assertion messages to provide better debugging experience in case of failures.
- Added a line to print the prettified execution information using the `prettify_exec_info` function.
- Included a comment to remind developers to add additional assertions on the result or execution info if needed.
- Fixed a minor typo in the configuration dictionary (`beautifulsoup` instead of `beautifoulsoup`).

Benefits:
- Improved code readability and maintainability with better documentation.
- Enhanced debugging experience with more informative assertion messages.
- Easier analysis of the ScriptCreatorGraph execution by printing the prettified execution information.
- Reminder to add more assertions for comprehensive testing of the ScriptCreatorGraph.
- Corrected a minor typo to ensure consistency.

The test suite now provides a more user-friendly experience for developers working on the ScriptCreatorGraph class. The printed execution information will aid in debugging and understanding the graph's execution flow, while the improved assertions and documentation will make the test suite more robust and maintainable.
Enhance tests for FetchNode with mocking
- Added pytest fixture to set up the RobotsNode with the initial state.
- Implemented test_robots_node to test the execution of RobotsNode.
- Used unittest.mock.patch to mock the execute method, ensuring faster and more reliable tests without actual network calls.
- Added assertions to verify the correctness of the result and ensure the execute method is called once with the correct arguments.
Test ScriptCreatorGraph and print execution info
feat: Add tests for RobotsNode and update test setup
## [1.6.0](v1.5.7...v1.6.0) (2024-06-09)

### Features

* Add tests for RobotsNode and update test setup ([dedfa2e](dedfa2e))

### Test

* Enhance JSON scraping pipeline test ([d845a1b](d845a1b))
@VinciGit00 VinciGit00 closed this Jun 9, 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.

6 participants