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
Marco Vinciguerra
261c4fcdf5
Merge pull request #352 from tejhande/patch-1
...
CodeQL / Analyze (python) (push) Waiting to run
/ build (3.10) (push) Waiting to run
Release / Build (push) Waiting to run
Release / Release (push) Blocked by required conditions
test: Enhance JSON scraping pipeline test
2024-06-07 09:55:14 +02:00
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
semantic-release-bot
c17daca409
ci(release): 1.5.7 [skip ci]
...
## [1.5.7](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.6...v1.5.7 ) (2024-06-06)
### Bug Fixes
* update openai tts class ([10672d6 ](10672d6ebb ))
2024-06-06 08:02:58 +00:00
Marco Vinciguerra
10672d6ebb
fix: update openai tts class
2024-06-06 10:00:58 +02:00
Marco Vinciguerra
e7af5ead59
Merge pull request #348 from tindo2003/fix_robots_node
CodeQL / Analyze (python) (push) Has been cancelled
/ build (3.10) (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Release (push) Has been cancelled
2024-06-05 17:11:04 +02:00
Tin Do
d772453220
Refactor model_name attribute access in llm_model in robots_node.py
...
- 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.
2024-06-05 11:00:33 -04:00
Marco Vinciguerra
9ef73d7363
Merge pull request #347 from duke147/ernie
...
CodeQL / Analyze (python) (push) Waiting to run
/ build (3.10) (push) Waiting to run
Release / Build (push) Waiting to run
Release / Release (push) Blocked by required conditions
add the Ernie context window
2024-06-05 13:22:26 +02:00
Marco Vinciguerra
95725789ff
add earnie example
2024-06-05 13:21:32 +02:00
duke147
1a404e358d
Merge remote-tracking branch 'upstream/main' into ernie
2024-06-05 19:14:44 +08:00
duke147
2b2b910a37
support ernie
2024-06-05 19:02:34 +08:00
Marco Vinciguerra
2ef6d67a9e
Merge pull request #346 from duke147/ernie
...
support ernie
2024-06-05 12:28:43 +02:00
semantic-release-bot
49cdadf117
ci(release): 1.5.6 [skip ci]
...
## [1.5.6](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.5...v1.5.6 ) (2024-06-05)
### Bug Fixes
* getter ([67d83cf ](67d83cff46 ))
2024-06-05 10:03:20 +00:00
Marco Vinciguerra
67d83cff46
fix: getter
2024-06-05 12:02:00 +02:00
duke147
4e16c9a81d
support ernie
2024-06-05 17:37:35 +08:00
semantic-release-bot
36292150da
ci(release): 1.5.5 [skip ci]
...
## [1.5.5](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.4...v1.5.5 ) (2024-06-05)
### Bug Fixes
* bug on generate_answer_node ([1d38ed1 ](1d38ed146a ))
### Docs
* add Japanese README ([4559ab6 ](4559ab6db8 ))
* update japanese.md ([f0042a8 ](f0042a8e33 ))
* update README.md ([871e398 ](871e398a26 ))
2024-06-05 07:18:31 +00:00
Marco Vinciguerra
1d38ed146a
fix: bug on generate_answer_node
2024-06-05 09:17:29 +02:00
Marco Vinciguerra
04b0352b79
Merge pull request #345 from eltociear/add-japanese-readme
...
docs: add Japanese README
2024-06-05 09:11:34 +02:00
Ikko Eltociear Ashimine
f0042a8e33
docs: update japanese.md
2024-06-05 16:07:18 +09:00
Ikko Eltociear Ashimine
871e398a26
docs: update README.md
2024-06-05 16:05:26 +09:00
Ikko Eltociear Ashimine
4559ab6db8
docs: add Japanese README
2024-06-05 16:04:37 +09:00
Marco Vinciguerra
28d874e4e1
Merge pull request #335 from jiangyuan-li/main
CodeQL / Analyze (python) (push) Has been cancelled
/ build (3.10) (push) Has been cancelled
Release / Build (push) Has been cancelled
Release / Release (push) Has been cancelled
2024-06-04 08:56:13 +02:00
Marco Vinciguerra
3141ac8687
Merge pull request #336 from SchneeHertz/main
2024-06-04 08:54:52 +02:00
SchneeHertz
12ecc99a6c
Update chinese.md
2024-06-04 14:46:22 +08:00
SchneeHertz
89f40f12bc
Update chinese.md
2024-06-04 14:38:33 +08:00
SchneeHertz
c4bf325728
Improve the Chinese Readme to synchronize with the English Readme.
2024-06-04 14:36:17 +08:00
Jiangyuan Li
8a52e138ec
Update README.md
...
Fix typos in translating "Chinese"
2024-06-03 17:19:47 -07:00
Marco Vinciguerra
08499c2cfb
Update README.md
CodeQL / Analyze (python) (push) Waiting to run
/ build (3.10) (push) Waiting to run
Release / Build (push) Waiting to run
Release / Release (push) Blocked by required conditions
2024-06-03 15:30:15 +02:00
Marco Vinciguerra
9992f8cef2
Merge pull request #325 from seyf97/patch-2
...
Update requirements.txt
2024-06-02 16:16:51 +02:00
seyf97
40bc77daca
Update requirements.txt
...
Remove duplicate requirement "langchain-anthropic"
2024-06-02 16:49:27 +03:00
semantic-release-bot
29b79cbdf1
ci(release): 1.5.4 [skip ci]
...
## [1.5.4](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.3...v1.5.4 ) (2024-05-31)
### Bug Fixes
* **3.9:** python 3.9 logging fix ([8be27ba ](8be27bad80 ))
2024-05-31 20:33:32 +00:00
Marco Perini
8be27bad80
fix(3.9): python 3.9 logging fix
2024-05-31 22:32:20 +02:00
semantic-release-bot
5619bca78e
ci(release): 1.5.3 [skip ci]
...
## [1.5.3](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.2...v1.5.3 ) (2024-05-30)
### Bug Fixes
* typo in generate_screper_node ([c4ce361 ](c4ce36111f ))
2024-05-30 16:51:20 +00:00
Marco Vinciguerra
c4ce36111f
fix: typo in generate_screper_node
2024-05-30 18:50:04 +02:00
Marco Vinciguerra
1adcab4c95
add chinese file
2024-05-30 18:44:46 +02:00
Marco Vinciguerra
287e17afd3
Update README.md
2024-05-29 10:58:29 +02:00
Marco Vinciguerra
3b90ebd9a8
add new examples
2024-05-29 10:41:37 +02:00
Marco Vinciguerra
9f73d7a3d7
Merge branch 'main' of https://github.com/VinciGit00/Scrapegraph-ai
2024-05-28 09:11:16 +02:00
Marco Vinciguerra
58dfe9b658
add examples of usage
2024-05-28 09:11:14 +02:00
Marco Vinciguerra
eb841c8aed
Merge pull request #310 from Yuan-ManX/README
2024-05-28 08:37:11 +02:00
Yuan-Man
ac3fa45b83
Update README.md
2024-05-28 11:33:08 +08:00
Marco Vinciguerra
004d03a0ff
add examples
2024-05-27 12:50:51 +02:00
Marco Vinciguerra
f4a253b513
removed unused file
2024-05-27 11:40:51 +02:00
semantic-release-bot
7f4a6a6aa4
ci(release): 1.5.2 [skip ci]
...
## [1.5.2](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.1...v1.5.2 ) (2024-05-26)
### Bug Fixes
* fixed typo ([54e8216 ](54e82163f0 ))
* Update __init__.py ([8f2c8d5 ](8f2c8d5d12 ))
2024-05-26 14:39:15 +00:00
Marco Perini
54e82163f0
fix: fixed typo
2024-05-26 16:38:10 +02:00
Marco Vinciguerra
8f2c8d5d12
Fix: Update __init__.py
2024-05-26 16:24:32 +02:00
semantic-release-bot
7f24dd4b2a
ci(release): 1.5.1 [skip ci]
...
## [1.5.1](https://github.com/VinciGit00/Scrapegraph-ai/compare/v1.5.0...v1.5.1 ) (2024-05-26)
### Bug Fixes
* **pdf-example:** added pdf example and coauthor ([a796169 ](a7961691df ))
* **schema:** added schema ([8d76c4b ](8d76c4b3cb ))
2024-05-26 13:40:33 +00:00
Marco Vinciguerra
3c7dedf9c8
Merge pull request #305 from VinciGit00/pdf_fix
...
Pdf fix
2024-05-26 15:39:21 +02:00
arsaboo
a7961691df
fix(pdf-example): added pdf example and coauthor
2024-05-26 15:09:49 +02:00
Marco Vinciguerra
fb74a5207e
update one_api example with schema
2024-05-26 12:22:53 +02:00