test_doc.py (598B)
1 # standard imports 2 import unittest 3 import os 4 import logging 5 6 # local imports 7 from confini import Config 8 from confini.doc import ConfigDoc 9 10 logging.basicConfig(level=logging.DEBUG) 11 12 13 class TestDoc(unittest.TestCase): 14 15 wd = os.path.dirname(__file__) 16 17 def test_from_config(self): 18 inidir = os.path.join(self.wd, 'files/doc/ok') 19 c = Config(inidir) 20 c.process() 21 22 doc = ConfigDoc.from_config(c) 23 self.assertEqual(doc.get('FOO_BAR'), 'foo of bar') 24 self.assertEqual(doc.get('BAR_XYZZY'), 'bar of xyzzy') 25 26 27 if __name__ == '__main__': 28 unittest.main()