Skip to content

Commit

Permalink
Fix config json (#56)
Browse files Browse the repository at this point in the history
* return none instead of empty dict

* bump version

* fix test

* Update image_test.py
  • Loading branch information
circa10a authored Nov 28, 2018
1 parent 8cb2021 commit bd6aa16
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ouroboros/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/image_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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():
Expand All @@ -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
assert 'Could not clean up image: testcontainer:1.1, reason:' in caplog.text

0 comments on commit bd6aa16

Please sign in to comment.