Skip to content

Commit

Permalink
Merge branch '383-status-should-be-uses-last-request-even-if-a-respon…
Browse files Browse the repository at this point in the history
…se-is-provided'
  • Loading branch information
lucagiove committed Nov 14, 2023
2 parents ff2d0a2 + bd42530 commit 533c31c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 2.7, 3.7, 3.8, 3.x ]
python-version: [ 3.7, 3.8, 3.x ]
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down
13 changes: 13 additions & 0 deletions atests/issues/334.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*** Settings ***
Library RequestsLibrary
Resource ../res_setup.robot

Suite Setup Setup Flask Http Server
Suite Teardown Teardown Flask Http Server And Sessions

*** Test Cases ***

Test evaluated response is always the one passed
${response_error}= GET On Session ${GLOBAL_SESSION} url=/status/404 expected_status=any
${response_ok}= GET On Session ${GLOBAL_SESSION} url=/status/200 expected_status=any
Status Should Be 404 ${response_error}
2 changes: 1 addition & 1 deletion src/RequestsLibrary/RequestsKeywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def status_should_be(self, expected_status, response=None, msg=None):
| ELSE
| [...]
"""
if not response:
if response is None:
response = self.last_response
self._check_status(expected_status, response, msg)

Expand Down
2 changes: 1 addition & 1 deletion src/RequestsLibrary/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.0a7'
VERSION = '1.0a8'

0 comments on commit 533c31c

Please sign in to comment.