Skip to content

Commit 40faddf

Browse files
committed
fix: status should be evaluate latest response if failed #383
1 parent 1b1b617 commit 40faddf

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

atests/issues/334.robot

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
*** Settings ***
2+
Library RequestsLibrary
3+
Resource ../res_setup.robot
4+
5+
Suite Setup Setup Flask Http Server
6+
Suite Teardown Teardown Flask Http Server And Sessions
7+
8+
*** Test Cases ***
9+
10+
Test evaluated response is always the one passed
11+
${response_error}= GET On Session ${GLOBAL_SESSION} url=/status/404 expected_status=any
12+
${response_ok}= GET On Session ${GLOBAL_SESSION} url=/status/200 expected_status=any
13+
Status Should Be 404 ${response_error}

atests/test_status_assertions.robot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Resource res_setup.robot
55
Suite Setup Setup Flask Http Server
66
Suite Teardown Teardown Flask Http Server And Sessions
77

8-
98
*** Test Cases ***
109

1110
Request And Status Should Be Different

src/RequestsLibrary/RequestsKeywords.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def status_should_be(self, expected_status, response=None, msg=None):
116116
| ELSE
117117
| [...]
118118
"""
119-
if not response:
119+
if response is None:
120120
response = self.last_response
121121
self._check_status(expected_status, response, msg)
122122

src/RequestsLibrary/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.9.5'
1+
VERSION = '0.9.6'

0 commit comments

Comments
 (0)