Commit Graph

69 Commits

Author SHA1 Message Date
Marco Vinciguerra
da0b744443 add test 2024-07-15 20:46:22 +02:00
Marco Vinciguerra
ba782a6af9 add compatibility for versions 2024-07-04 21:04:47 +02:00
Federico Aguzzi
104d8692d6
Merge branch 'pre/beta' into support
Some checks failed
/ build (push) Has been cancelled
2024-07-04 18:36:34 +02:00
Federico Aguzzi
720f18729b Merge branch 'fireworks_integration' into support 2024-07-04 18:17:38 +02:00
Marco Vinciguerra
4b56604413 add examples + test
Some checks failed
/ build (3.10) (push) Has been cancelled
2024-06-25 10:32:29 +02:00
Marco Vinciguerra
3a537eec6f fix: add test 2024-06-23 17:54:09 +02:00
Marco Vinciguerra
cf9a3d1a2f add test 2024-06-21 14:42:54 +02:00
Marco Vinciguerra
aa2160c108 feat: add research with bing + test function
Some checks failed
/ build (3.10) (push) Has been cancelled
2024-06-18 21:28:29 +02:00
Marco Vinciguerra
073d226723 feat: add new search engine avaiability and new tests 2024-06-18 14:35:13 +02:00
Marco Vinciguerra
6a753f2803 add smart_scraper_openai_test 2024-06-17 11:17:08 +02:00
Marco Vinciguerra
2419003999 fix: fix robot node
Some checks are pending
/ build (3.10) (push) Waiting to run
Release / Build (push) Waiting to run
Release / Release (push) Blocked by required conditions
2024-06-16 14:04:36 +02:00
Marco Vinciguerra
c31706fdae fixed tests
Some checks are pending
/ build (3.10) (push) Waiting to run
Release / Build (push) Waiting to run
Release / Release (push) Blocked by required conditions
Co-Authored-By: Matteo Vedovati <68272450+vedovati-matteo@users.noreply.github.com>
2024-06-15 20:41:26 +02:00
Marco Vinciguerra
7a34562d50 refactoring of merging answers nodes 2024-06-13 21:41:54 +02:00
Marco Vinciguerra
49c7e0eaab fix: test for fetch node 2024-06-13 11:04:59 +02:00
iamgodot
17dd936af7 test: fix tests for fetch node with proper mock&refactor 2024-06-12 22:45:43 -07:00
Tejas Amol Hande
40747c3e01
Merge branch 'main' into main 2024-06-10 13:36:44 +05:30
Tejas Amol Hande
c927145bd0
feat: Add tests for SmartScraperGraph using sample text and configuration fixtures (@tejhande)
- Added pytest fixture to provide sample text from a file.
- Added pytest fixture to provide graph configuration.
- Implemented test_scraping_pipeline to test the execution of SmartScraperGraph.
- Added assertions to verify the result is not None and to check the expected structure of the result.

Contributed by @tejhande
2024-06-10 13:33:05 +05:30
Tejas Amol Hande
c286b1649e
feat: Add tests for SmartScraperGraph using sample text and configuration fixtures (@tejhande)
- Added pytest fixture to provide sample text from a file.
- Added pytest fixture to provide graph configuration.
- Implemented test_scraping_pipeline to test the execution of SmartScraperGraph.
- Added assertions to verify the result is not None and to check the expected structure of the result.

Contributed by @tejhande
2024-06-10 13:27:31 +05:30
Tejas Amol Hande
08f1be682b
feat: Add tests for SmartScraperGraph using sample text and configuration fixtures (@tejhande)
- Added pytest fixture to provide sample text from a file.
- Added pytest fixture to provide graph configuration.
- Implemented test_scraping_pipeline to test the execution of SmartScraperGraph.
- Added assertions to verify the result is not None and to check the expected structure of the result.

Contributed by @your-github-username
2024-06-10 13:25:10 +05:30
Tejas Amol Hande
b0511aeaaa
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.
2024-06-10 13:21:56 +05:30
Marco Vinciguerra
e688480771
Merge pull request #362 from tejhande/patch-4
feat: Add tests for RobotsNode and update test setup
2024-06-09 16:59:50 +02:00
Marco Vinciguerra
2781c3c46b
Merge pull request #355 from tejhande/patch-3
Test ScriptCreatorGraph and print execution info
2024-06-09 16:57:36 +02:00
tejhande
13f8ca56b2 "Refactor SearchLinkNode test: simplify setup, add patching for execute method, and enhance assertions" 2024-06-09 19:48:33 +05:30
Tejas Amol Hande
dedfa2eaf0
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.
2024-06-09 19:39:11 +05:30
Tejas Amol Hande
ff9df81e60
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.
2024-06-07 23:17:58 +05:30
Tejas Amol Hande
320f13fa89
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.
2024-06-07 23:11:32 +05:30
Tejas Amol Hande
d845a1ba7d
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.
2024-06-07 13:00:54 +05:30
duke147
4e16c9a81d support ernie 2024-06-05 17:37:35 +08:00
Marco Vinciguerra
b913b51cca Merge branch 'logger-integration' into pre/beta 2024-05-24 12:39:14 +02:00
Marco Vinciguerra
3453f72397 add graph 2024-05-17 18:23:50 +02:00
VinciGit00
a4700bfc75 add robot node 2024-05-15 12:00:32 +02:00
VinciGit00
d6f5ca874f Merge branch 'main' into pre/beta 2024-05-14 10:24:29 +02:00
VinciGit00
76b0e39db0 update tests 2024-05-11 12:23:50 +02:00
Federico Minutoli
217013181d feat(proxy-rotation): add parse (IP address) or search (from broker) functionality for proxy rotation
the broker has been made fully configurable for anonymity level, admissible locations, scheme and max shape not to waste resources, unlike the original `free-proxy` package.

other options have been explored (e.g., `proxybroker`, `proxybroker2`) due to their built-in proxy server and rotation capabilities, but the former is no longer maintained, and the latter has issue with any python version outside of python 3.9
2024-05-10 21:09:48 +02:00
Federico Minutoli
db2234bf5d feat(webdriver-backend): add dynamic import scripts from module and file 2024-05-10 21:06:05 +02:00
Marco Vinciguerra
a2d5c75f10
Merge branch 'pre/beta' into main 2024-05-02 17:55:21 +02:00
VinciGit00
5cf4e4f92f fix: examples and graphs 2024-05-02 09:20:46 +02:00
VinciGit00
7c1b5796d7 add csv scraper 2024-05-01 17:20:04 +02:00
VinciGit00
45b2317ab7 add json examples 2024-04-29 11:16:48 +02:00
VinciGit00
9cd516507c fix: bug with fetch node 2024-04-27 21:23:35 +02:00
VinciGit00
a73496df9b refactoring of nodes 2024-04-24 21:13:27 +02:00
EURAC\marperini
ae49dee985 fixed robots_node and add test 2024-04-24 16:12:53 +02:00
VinciGit00
8aa2cadb00 add integration for llama3 2024-04-21 13:11:10 +02:00
VinciGit00
a2349e56af recatoring of nodes excluive for openai 2024-04-19 13:21:48 +02:00
VinciGit00
7815473b6d Update script_generator_test.py 2024-04-19 10:37:22 +02:00
VinciGit00
3f95801737 Merge branch 'main' of https://github.com/VinciGit00/Scrapegraph-ai 2024-04-19 10:36:40 +02:00
VinciGit00
1107630d27 add new test for script generator 2024-04-18 10:39:53 +02:00
Marco Perini
b14527c08d
Merge branch 'main' into refactor_generate_answer_node 2024-04-17 12:08:43 +02:00
Andrea Rota
b0e446f014 feat: apply remove to the document before updating the state 2024-04-17 11:24:56 +02:00
VinciGit00
4a63e2a692 refactoring of the tests 2024-04-16 21:55:13 +02:00