MarketSquare / robotframework-requests

Robot Framework keyword library wrapper for requests
http://marketsquare.github.io/robotframework-requests/
MIT License
488 stars 280 forks source link

feat: Add support for uploading files as a list #403

Closed vanhanit closed 4 days ago

vanhanit commented 1 month ago

Uploading a list of files with the same key is supported by the Requests library. This allows the receiving server to accept a list of files for the same key, i.e. accepting any number of files.

Issue: #401

vanhanit commented 1 month ago

This could also be a candidate for a back-port to the 0.9 version as well.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.86%. Comparing base (1e34855) to head (0fadd9f). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #403 +/- ## ========================================== + Coverage 85.07% 88.86% +3.79% ========================================== Files 9 9 Lines 469 476 +7 Branches 47 49 +2 ========================================== + Hits 399 423 +24 + Misses 65 51 -14 + Partials 5 2 -3 ``` | [Flag](https://app.codecov.io/gh/MarketSquare/robotframework-requests/pull/403/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MarketSquare) | Coverage Δ | | |---|---|---| | [acceptance](https://app.codecov.io/gh/MarketSquare/robotframework-requests/pull/403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MarketSquare) | `85.29% <100.00%> (+0.21%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/MarketSquare/robotframework-requests/pull/403/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MarketSquare) | `60.08% <80.00%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=MarketSquare#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vanhanit commented 1 week ago

Added verification to the Robot Framework tests to verify that the file descriptors are closed for both use cases.

lucagiove commented 1 week ago

Added verification to the Robot Framework tests to verify that the file descriptors are closed for both use cases.

there was already a unit test for check file closing

vanhanit commented 1 week ago

Added verification to the Robot Framework tests to verify that the file descriptors are closed for both use cases.

there was already a unit test for check file closing

Well, I did not dig too deep to find that. The Robot test ensures that both a dictionary and a list is tested. It does not test having files in the data section. Maybe the unit test covers this?

vanhanit commented 1 week ago

I rebased on master. I don't think that my changes is what is causing the test to fail.

lucagiove commented 1 week ago

I rebased on master. I don't think that my changes is what is causing the test to fail.

no it's not your commit, there are still some tests that use a web version of httpbin, sometimes they throttle the requests... they should be changed but there are tests also for https certificates so not easy to implement locally

vanhanit commented 1 week ago

I rebased on master. I don't think that my changes is what is causing the test to fail.

no it's not your commit, there are still some tests that use a web version of httpbin, sometimes they throttle the requests... they should be changed but there are tests also for https certificates so not easy to implement locally

Yeah, it is the same test that also fails locally for me.

vanhanit commented 4 days ago

@lucagiove Was there anything I still needed to do with this? How do we rerun the builds?

vanhanit commented 4 days ago

No I would have added also the unit test but mandatory. I'll try to have the pipeline running.

But didn't you say that there already are a unit test for the closing of file descriptors? Or was there some other unit test that you wanted to run? Either way, there are a couple of Robot Framework tests that cover the functionality.

lucagiove commented 4 days ago

No I would have added also the unit test but mandatory. I'll try to have the pipeline running.

But didn't you say that there already are a unit test for the closing of file descriptors? Or was there some other unit test that you wanted to run? Either way, there are a couple of Robot Framework tests that cover the functionality.

Yep but not with the specific input of a list.