From 510da936c274d852018c9acc28f59c17f90c534f Mon Sep 17 00:00:00 2001 From: Maxime Franco Date: Wed, 15 Jan 2020 16:38:20 +0100 Subject: [PATCH 1/2] Issue 3 correction. Add an indication if the tool is running in authenticated mode or in basic mode --- swaggercheck/_basictests.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/swaggercheck/_basictests.py b/swaggercheck/_basictests.py index 105710a..abeda55 100644 --- a/swaggercheck/_basictests.py +++ b/swaggercheck/_basictests.py @@ -48,6 +48,14 @@ def api_conformance_test( Fore.BLUE + "Swagger client... " + Fore.GREEN + " ok" + Style.RESET_ALL ) + method = " authenticated" + if username is None and password is None: + method = " basic" + + print( + Fore.BLUE + "Authentication method : " + Fore.GREEN + method + Style.RESET_ALL + ) + fd, watchdog_filename = tempfile.mkstemp() os.close(fd) os.remove(watchdog_filename) From d884604b338afcbda3679fd8baca87721fbf1197 Mon Sep 17 00:00:00 2001 From: Maxime Franco Date: Sat, 18 Jan 2020 20:12:17 +0100 Subject: [PATCH 2/2] correction hypothesis --- requirements-dev.txt | 2 ++ swaggercheck/_basictests.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4910009..dd0343f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,7 @@ +hypothesis==4.31.0 black==19.3b0 coveralls pytest==4.4.1 pytest-cov==2.7.1 responses==0.5.1 + diff --git a/swaggercheck/_basictests.py b/swaggercheck/_basictests.py index abeda55..5749f2d 100644 --- a/swaggercheck/_basictests.py +++ b/swaggercheck/_basictests.py @@ -48,9 +48,9 @@ def api_conformance_test( Fore.BLUE + "Swagger client... " + Fore.GREEN + " ok" + Style.RESET_ALL ) - method = " authenticated" - if username is None and password is None: - method = " basic" + method = " basic" + if username is not None and password is not None: + method = " authenticated" print( Fore.BLUE + "Authentication method : " + Fore.GREEN + method + Style.RESET_ALL