diff --git a/ldap_expire_notify/channel/__init__.py b/ldap_expire_notify/channel/__init__.py index d57b674..a1e403a 100644 --- a/ldap_expire_notify/channel/__init__.py +++ b/ldap_expire_notify/channel/__init__.py @@ -18,10 +18,10 @@ def parse(path): + data = {'channels': {}} if os.path.isfile(path): data = parse_file(path) elif os.path.isdir(path): - data = {'channels': {}} for root, _, files in os.walk(path): for f in files: abs_path = os.path.join(root, f) diff --git a/ldap_expire_notify/meta.py b/ldap_expire_notify/meta.py index 58bf093..36c5348 100644 --- a/ldap_expire_notify/meta.py +++ b/ldap_expire_notify/meta.py @@ -1,4 +1,4 @@ author = 'Victor Cabezas' author_email = 'vcabezas@tuenti.com' -version = '0.1.0' +version = '0.1.1' description = 'Notify users of OpenLDAP about the expiration of their password' diff --git a/tests/test_channel.py b/tests/test_channel.py index 015e950..18359b8 100644 --- a/tests/test_channel.py +++ b/tests/test_channel.py @@ -24,6 +24,9 @@ def test_parse_directory_ko(): with pytest.raises(ValueError): r = channel.parse('/tmp/') + with pytest.raises(ValueError): + r = channel.parse('/non-existent-chan/') + def test_parse_directory(): r = channel.parse('channels/')