bugfix - exception no longer thrown on lone comment delimiter

This commit is contained in:
Chris Caron 2019-08-17 23:38:55 -04:00
parent a3abe06bbf
commit 805bec2396
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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():
"""