From 084fbcdb61d88bebfa57e88df347fcdbf977f529 Mon Sep 17 00:00:00 2001 From: justin-h-loi Date: Tue, 15 Aug 2023 16:14:55 -0400 Subject: [PATCH] Make unit tests use default config --- .github/workflows/.travis.yml | 1 + .github/workflows/run_travis.yml | 21 --------------------- kmip/core/config_helper.py | 2 ++ kmip/services/server/session.py | 3 +-- 4 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 .github/workflows/run_travis.yml diff --git a/.github/workflows/.travis.yml b/.github/workflows/.travis.yml index 662a4b4..eef34b8 100644 --- a/.github/workflows/.travis.yml +++ b/.github/workflows/.travis.yml @@ -10,6 +10,7 @@ jobs: build: runs-on: ${{ matrix.os }} env: + UNITTEST: ${{ true }} TOXENV: ${{ matrix.test }} RUN_INTEGRATION_TESTS: ${{ matrix.test_number}} steps: diff --git a/.github/workflows/run_travis.yml b/.github/workflows/run_travis.yml deleted file mode 100644 index 5a25eeb..0000000 --- a/.github/workflows/run_travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Run Travis.yml" - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - name: Run .travis.yml build script - uses: ktomk/run-travis-yml@v1.8.1 - with: - file: .travis.yml - steps: | - install - script - allow-failure: false \ No newline at end of file diff --git a/kmip/core/config_helper.py b/kmip/core/config_helper.py index a204666..a816dcd 100644 --- a/kmip/core/config_helper.py +++ b/kmip/core/config_helper.py @@ -27,6 +27,8 @@ CONFIG_FILE = [ os.path.normpath(os.path.join(FILE_PATH, '../pykmip.conf')), os.path.normpath(os.path.join(FILE_PATH, '../kmipconfig.ini'))] +if os.environ.get("UNITTEST"): + CONFIG_FILE = [] class ConfigHelper(object): NONE_VALUE = 'None' diff --git a/kmip/services/server/session.py b/kmip/services/server/session.py index 3664d93..2b17ef0 100644 --- a/kmip/services/server/session.py +++ b/kmip/services/server/session.py @@ -128,8 +128,7 @@ class KmipSession(threading.Thread): try: if hasattr(self._connection, 'shared_ciphers') \ - and self._connection.shared_ciphers() is not None: - + and self._connection.shared_ciphers() is not None: shared_ciphers = self._connection.shared_ciphers() self._logger.debug( "Possible session ciphers: {0}".format(len(shared_ciphers))