changeset 49:7364d06af5b9

passing test
author Jeff Hammel <k0scist@gmail.com>
date Fri, 13 Aug 2021 15:12:53 -0700
parents 8fbf968e8dea
children 4b2c3be35225
files silvermirror/unify.py test/test_unify.py
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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`"""
--- 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)
+