diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 74cf224..75fc4e3 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/issues/334.robot b/atests/issues/334.robot new file mode 100644 index 0000000..f58426b --- /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/src/RequestsLibrary/RequestsKeywords.py b/src/RequestsLibrary/RequestsKeywords.py index c33fa7c..9b65719 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 1282e1f..84566a9 100644 --- a/src/RequestsLibrary/version.py +++ b/src/RequestsLibrary/version.py @@ -1 +1 @@ -VERSION = '1.0a7' \ No newline at end of file +VERSION = '1.0a8'