# HG changeset patch # User Jeff Hammel # Date 1628892773 25200 # Node ID 7364d06af5b9b4ed287a7f846b5715db986ae76b # Parent 8fbf968e8dea0f19e877069009e0ebb263ae73b8 passing test diff -r 8fbf968e8dea -r 7364d06af5b9 silvermirror/unify.py --- a/silvermirror/unify.py Fri Aug 13 15:07:11 2021 -0700 +++ b/silvermirror/unify.py Fri Aug 13 15:12:53 2021 -0700 @@ -27,8 +27,11 @@ def ini2dict(filename): config = configparser.ConfigParser() config.read(filename) + retval = {} for section in config.sections(): - raise NotImplementedError('TODO') + retval[section] = dict(config.items(section, raw=True)) + return retval + def read_config(filename): """read configuration `filename`""" diff -r 8fbf968e8dea -r 7364d06af5b9 test/test_unify.py --- a/test/test_unify.py Fri Aug 13 15:07:11 2021 -0700 +++ b/test/test_unify.py Fri Aug 13 15:12:53 2021 -0700 @@ -1,6 +1,12 @@ # Requires `pytest` +import os from silvermirror import unify +HERE = os.path.dirname(os.path.abspath(__file__)) +CONF = os.path.join(HERE, 'silvermirror.ini') + + def test_read_config(): - assert True # TODO + unify.read_config(CONF) +