From bd6aa16bf4e8e545ebe5ee77d1864c7e7e6c5229 Mon Sep 17 00:00:00 2001 From: Caleb Lemoine <21261388+circa10a@users.noreply.github.com> Date: Wed, 28 Nov 2018 10:09:58 -0600 Subject: [PATCH] Fix config json (#56) * return none instead of empty dict * bump version * fix test * Update image_test.py --- ouroboros/image.py | 2 +- setup.py | 2 +- tests/unit/image_test.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ouroboros/image.py b/ouroboros/image.py index 3849511d..8baf2155 100644 --- a/ouroboros/image.py +++ b/ouroboros/image.py @@ -10,7 +10,7 @@ def check_credentials(): if environ.get('REPO_USER') and environ.get('REPO_PASS'): return {'username': environ['REPO_USER'], 'password': environ['REPO_PASS']} - return {} + return None def pull_latest(image, keep_tag, api_client): diff --git a/setup.py b/setup.py index f6bab448..561073bd 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ def read_reqs(requirements): setup( name='ouroboros-cli', - version='0.3.1', + version='0.3.2', description='Automatically update running docker containers', long_description=readme(), long_description_content_type='text/markdown', diff --git a/tests/unit/image_test.py b/tests/unit/image_test.py index c538205e..81d38055 100644 --- a/tests/unit/image_test.py +++ b/tests/unit/image_test.py @@ -4,7 +4,7 @@ def test_image_check_credentials_no_env_var(): - assert image.check_credentials() == {} + assert not image.check_credentials() def test_image_check_credentials_env_var(mocker): @@ -14,7 +14,7 @@ def test_image_check_credentials_env_var(mocker): def test_image_check_credentials_false_env_var(mocker): mocker.patch.dict('os.environ', {'REPO_USR': 'test_user', 'REPO_PaSS': 'test_pass'}) - assert image.check_credentials() == {} + assert not image.check_credentials() def test_image_is_up_to_date(): @@ -32,4 +32,4 @@ def test_remove_exception(mocker, caplog): image.remove(fake_image, fake_api) fake_api.remove_image.assert_called_once_with(fake_image) - assert 'Could not clean up image: testcontainer:1.1, reason:' in caplog.text \ No newline at end of file + assert 'Could not clean up image: testcontainer:1.1, reason:' in caplog.text