-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Add unitests for BrowserToolkit #2000
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
Conversation
Wendong-Fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @JoyceXu02 's contribution! We’ve merged a PR that also updates the unit tests and example code. Could you review the current implementation and integrate your work with the existing one? Sorry for the inconvenience
d0fc548 to
f4f16bb
Compare
Wendong-Fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @JoyceXu02 , left comments below, also please pay attention to pre-commit check in cicd, now there's something need to be fixed
camel/toolkits/browser_toolkit.py
Outdated
| # Use urlparser for a safer extraction the url name | ||
| parsed_url = urllib.parse.urlparse(self.page_url) | ||
| url_name = os.path.basename(str(parsed_url)) or "index" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems urllib.parse.urlparse() returns a ParseResult object, and calling str(parsed_url) will convert the entire object to a string representation, not just the path componen, this will likely not give the expected result?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Wendong-Fan, I updated url_name assignment.
…l-ai/camel into feat/enhance_browsertoolkit
thanks @Wendong-Fan, pre-commit check has passed on my side. |
Wendong-Fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @JoyceXu02 for the contribution!
Description
Added some unitests for BrowserToolkit, and updated a safer url extractor.
Checklist
Go over all the following points, and put an
xin all the boxes that apply.Fixes #issue-numberin the PR description (required)pyproject.tomlanduv lockPartially fixed [Feature Request] Enhance BrowserToolkit #1752
If you are unsure about any of these, don't hesitate to ask. We are here to help!