-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add iter_lines Method to FastHttpSession Class #3024
Conversation
在 FastHttpSession 类中添加 iter_lines 方法
Reuses the logic of the request method and provides type annotations to enhance code readability and consistency.
fix: Remove trailing whitespace from blank line in fasthttp.py to comply with PEP 8
fix: fasthttp.py to comply with PEP 8
Looks good, but can you add a test case too? (in test_fasthttp.py) |
The lack of an endpoint that can return streaming data or a simulated response might be the reason for the test failure. |
Can you use the /streaming/:int: endpoint defined here? locust/locust/test/testcases.py Line 119 in 81116b2
|
I have just completed the implementation of the iter_lines method in FastHttpSession and successfully passed all related tests. I look forward to your review and feedback on this part of the work. |
Looks nice! (sorry for the lack of activity) Does it make sense to have a parameter for method? (it can still default to GET) Can the test also ensure that a the request is logged? You can look at the other tests for examples. |
Ping @MasterKey-Pro :) |
… method (default is still GET). 2. Used assert_called_once_with to ensure the request method is called with the correct parameters. 3. Added a logging feature and used assertLogs to check if the request information is logged.
… method (default is still GET). 2. Used assert_called_once_with to ensure the request method is called with the correct parameters. 3. Added a logging feature and used assertLogs to check if the request information is logged.
@cyberw Hello, apologies for the delay in responding as I was on an extended vacation. Regarding the changes, the main updates are as follows: Added a method parameter to allow the caller to customize the HTTP method (default is still GET); |
Awesome! I'll make sure it gets visible in the documentation too. |
@cyberw I've always wanted to express my gratitude, and I'm glad I finally have the chance. It’s an honor to be part of this, which has brought me great involvement and a sense of accomplishment. Thank you and the team for your hard work. Locust has helped me grow my skills in the competitive job market, while also creating a better future for me and my family. Your dedication to maintaining Locust has impacted many professionals, giving us more opportunities and hope. I wish you and the team continued success, and for Locust to keep growing |
1、Add iter_lines Method to FastHttpSession Class
2、fix: Remove trailing whitespace from blank line in fasthttp.py to comply with PEP 8
Fixes #3018