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

383 status should be uses last request even if a response is provided #384

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion atests/http_server/run.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
set FLASK_APP=core.py
python -m flask run
python -m flask run --port 5010
2 changes: 1 addition & 1 deletion atests/http_server/run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
export FLASK_APP=core.py
python -m flask run
python -m flask run --port 5010
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 atests/res_setup.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Library RequestsLibrary

*** Variables ***
${GLOBAL_SESSION} global_session
${HTTP_LOCAL_SERVER} http://localhost:5000
${HTTP_LOCAL_SERVER} http://localhost:5010


*** Keywords ***
Expand Down
1 change: 0 additions & 1 deletion atests/test_status_assertions.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Resource res_setup.robot
Suite Setup Setup Flask Http Server
Suite Teardown Teardown Flask Http Server And Sessions


*** Test Cases ***

Request And Status Should Be Different
Expand Down
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 = '0.9.5'
VERSION = '0.9.6'
Loading