From 805bec23968a350dac4e89e2c0ab5b57932ad1d7 Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Sat, 17 Aug 2019 23:38:55 -0400 Subject: [PATCH] bugfix - exception no longer thrown on lone comment delimiter --- apprise/config/ConfigBase.py | 2 +- test/test_config_base.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apprise/config/ConfigBase.py b/apprise/config/ConfigBase.py index d5acc4af..2c3bd5ff 100644 --- a/apprise/config/ConfigBase.py +++ b/apprise/config/ConfigBase.py @@ -236,7 +236,7 @@ class ConfigBase(URLBase): # otherwise. return list() - if result.group('comment') or not result.group('line'): + if not result.group('url'): # Comment/empty line; do nothing continue diff --git a/test/test_config_base.py b/test/test_config_base.py index 727b1ddc..6074224c 100644 --- a/test/test_config_base.py +++ b/test/test_config_base.py @@ -176,6 +176,18 @@ def test_config_base_config_parse_text(): assert isinstance(result, list) assert len(result) == 0 + # Test case where a comment is on it's own line with nothing else + result = ConfigBase.config_parse_text("#") + # We expect to parse 0 entries from the above + assert isinstance(result, list) + assert len(result) == 0 + + # Test case of empty file + result = ConfigBase.config_parse_text("") + # We expect to parse 0 entries from the above + assert isinstance(result, list) + assert len(result) == 0 + def test_config_base_config_parse_yaml(): """