Skip to content

Commit 01cab99

Browse files
authored
Merge pull request #384 from MarketSquare/383-status-should-be-uses-last-request-even-if-a-response-is-provided
#383 status should be uses last request even if a response is provided
2 parents b8a87e3 + bd42530 commit 01cab99

File tree

8 files changed

+19
-7
lines changed

8 files changed

+19
-7
lines changed

.github/workflows/pythonapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: [ ubuntu-latest, macos-latest, windows-latest ]
14-
python-version: [ 2.7, 3.7, 3.8, 3.x ]
14+
python-version: [ 3.7, 3.8, 3.x ]
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up Python

atests/http_server/run.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@echo off
22
set FLASK_APP=core.py
3-
python -m flask run
3+
python -m flask run --port 5010

atests/http_server/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
export FLASK_APP=core.py
3-
python -m flask run
3+
python -m flask run --port 5010

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/res_setup.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Library RequestsLibrary
55

66
*** Variables ***
77
${GLOBAL_SESSION} global_session
8-
${HTTP_LOCAL_SERVER} http://localhost:5000
8+
${HTTP_LOCAL_SERVER} http://localhost:5010
99

1010

1111
*** Keywords ***

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)