Skip to content
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 keyword to get response from last request #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PaulBrandUWV
Copy link
Contributor

This Pull request adds a keyword to get the response from the last request.
The keyword can be used to create much cleaner testcases because the response does not have to be stored to a variable in the test case.

Example:

*** Settings ***
Library     RequestsLibrary

*** Variables ***
${url}    https://httpbin.org/base64
${data}    anlmhcrh7853r042yqtx7rhaohfx,jr0aofds*&*^$IHLFEMXhkdjsxhcc
${base64_data}    YW5sbWhjcmg3ODUzcjA0MnlxdHg3cmhhb2hmeCxqcjBhb2ZkcyomKl4kSUhMRkVNWGhrZGpzeGhjYw==

*** Keywords ***
Response body equals
    [Arguments]    ${data}
    ${response}=   Get response
    Should be equal    ${response.text}    ${data}

*** Test cases ***
httpbin base64 decode
    When get  ${url}/${base64_data}
    Then response body equals    ${data}

This PR also removes some skipif decorators from the unit tests for old python versions.

Removes some skipif decorators from the unit tests for old python versions
Copy link

codecov bot commented Jun 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.67%. Comparing base (8a42d5c) to head (ea3cd17).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #397      +/-   ##
==========================================
+ Coverage   84.94%   88.67%   +3.72%     
==========================================
  Files           9        9              
  Lines         465      468       +3     
  Branches      116      117       +1     
==========================================
+ Hits          395      415      +20     
+ Misses         65       51      -14     
+ Partials        5        2       -3     
Flag Coverage Δ
acceptance 85.04% <100.00%> (+0.09%) ⬆️
unit 59.61% <66.66%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PaulBrandUWV
Copy link
Contributor Author

@lucagiove what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant