From 1b1b6170f2e6724b2ccaebc1a8de9e3c5c524bcc Mon Sep 17 00:00:00 2001 From: Luca Giovenzana Date: Tue, 14 Nov 2023 22:49:14 +0100 Subject: [PATCH 1/3] fix: local http server port conflict on mac (cherry picked from commit ff2d0a2a016d0a53b13a3eeb72a609fbd4be9102) --- atests/http_server/run.cmd | 2 +- atests/http_server/run.sh | 2 +- atests/res_setup.robot | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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/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 *** From 40faddfcbdde66d94f4306848374faff3543eac7 Mon Sep 17 00:00:00 2001 From: Luca Giovenzana Date: Tue, 14 Nov 2023 22:58:01 +0100 Subject: [PATCH 2/3] fix: status should be evaluate latest response if failed #383 --- atests/issues/334.robot | 13 +++++++++++++ atests/test_status_assertions.robot | 1 - src/RequestsLibrary/RequestsKeywords.py | 2 +- src/RequestsLibrary/version.py | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 atests/issues/334.robot 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/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' From bd425309502c93a0266366379d24cd29f151141d Mon Sep 17 00:00:00 2001 From: Luca Giovenzana Date: Tue, 14 Nov 2023 23:00:27 +0100 Subject: [PATCH 3/3] build: remove support for python 2.7 in ci --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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