-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Comparing changes
Open a pull request
base repository: ScrapeGraphAI/Scrapegraph-ai
base: v1.5.7
head repository: ScrapeGraphAI/Scrapegraph-ai
compare: v1.6.0
- 11 commits
- 10 files changed
- 4 contributors
Commits on Jun 7, 2024
-
test: Enhance JSON scraping pipeline test
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.
Configuration menu - View commit details
-
Copy full SHA for d845a1b - Browse repository at this point
Copy the full SHA d845a1bView commit details -
Merge pull request #352 from tejhande/patch-1
test: Enhance JSON scraping pipeline test
Configuration menu - View commit details
-
Copy full SHA for 261c4fc - Browse repository at this point
Copy the full SHA 261c4fcView commit details -
Enhance tests for FetchNode with mocking
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.
Configuration menu - View commit details
-
Copy full SHA for 320f13f - Browse repository at this point
Copy the full SHA 320f13fView commit details -
Test ScriptCreatorGraph and print execution info
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.
Configuration menu - View commit details
-
Copy full SHA for ff9df81 - Browse repository at this point
Copy the full SHA ff9df81View commit details
Commits on Jun 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c78aa43 - Browse repository at this point
Copy the full SHA c78aa43View commit details
Commits on Jun 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 5dc6165 - Browse repository at this point
Copy the full SHA 5dc6165View commit details -
Merge pull request #354 from tejhande/patch-2
Enhance tests for FetchNode with mocking
Configuration menu - View commit details
-
Copy full SHA for 14d1011 - Browse repository at this point
Copy the full SHA 14d1011View commit details -
feat: Add tests for RobotsNode and update test setup
- 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.
Configuration menu - View commit details
-
Copy full SHA for dedfa2e - Browse repository at this point
Copy the full SHA dedfa2eView commit details -
Merge pull request #355 from tejhande/patch-3
Test ScriptCreatorGraph and print execution info
Configuration menu - View commit details
-
Copy full SHA for 2781c3c - Browse repository at this point
Copy the full SHA 2781c3cView commit details -
Merge pull request #362 from tejhande/patch-4
feat: Add tests for RobotsNode and update test setup
Configuration menu - View commit details
-
Copy full SHA for e688480 - Browse repository at this point
Copy the full SHA e688480View commit details -
## [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))
Configuration menu - View commit details
-
Copy full SHA for 58086ee - Browse repository at this point
Copy the full SHA 58086eeView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v1.5.7...v1.6.0