diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 74cf2242..75fc4e36 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -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 diff --git a/atests/http_server/run.cmd b/atests/http_server/run.cmd index d1a38880..6464743b 100644 --- a/atests/http_server/run.cmd +++ b/atests/http_server/run.cmd @@ -1,3 +1,3 @@ @echo off set FLASK_APP=core.py -python -m flask run +python -m flask run --port 5010 diff --git a/atests/http_server/run.sh b/atests/http_server/run.sh index 0e2ae008..72a04842 100755 --- a/atests/http_server/run.sh +++ b/atests/http_server/run.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash export FLASK_APP=core.py -python -m flask run +python -m flask run --port 5010 diff --git a/atests/issues/334.robot b/atests/issues/334.robot new file mode 100644 index 00000000..f58426bc --- /dev/null +++ b/atests/issues/334.robot @@ -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} diff --git a/atests/res_setup.robot b/atests/res_setup.robot index 6dfef50c..9ab6ae9c 100644 --- a/atests/res_setup.robot +++ b/atests/res_setup.robot @@ -5,7 +5,7 @@ Library RequestsLibrary *** Variables *** ${GLOBAL_SESSION} global_session -${HTTP_LOCAL_SERVER} http://localhost:5000 +${HTTP_LOCAL_SERVER} http://localhost:5010 *** Keywords *** diff --git a/atests/test_status_assertions.robot b/atests/test_status_assertions.robot index 8716b684..3cf12ab6 100644 --- a/atests/test_status_assertions.robot +++ b/atests/test_status_assertions.robot @@ -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 diff --git a/src/RequestsLibrary/RequestsKeywords.py b/src/RequestsLibrary/RequestsKeywords.py index ad0133a4..ac3bce87 100644 --- a/src/RequestsLibrary/RequestsKeywords.py +++ b/src/RequestsLibrary/RequestsKeywords.py @@ -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) diff --git a/src/RequestsLibrary/version.py b/src/RequestsLibrary/version.py index 8377f8de..4d658450 100644 --- a/src/RequestsLibrary/version.py +++ b/src/RequestsLibrary/version.py @@ -1 +1 @@ -VERSION = '0.9.5' \ No newline at end of file +VERSION = '0.9.6'