# Path: simiki/config.py
# def parse_config(config_file):
#     if not os.path.exists(config_file):
#         raise ConfigFileNotFound("{0} not exists".format(config_file))
# 
#     default_config = _set_default_config()
# 
#     with io.open(config_file, "rt", encoding="utf-8") as fd:
#         config = yaml.load(fd, Loader=yaml.FullLoader)
# 
#     default_config.update(config)
#     config = _post_process(default_config)
# 
#     return config
# 
# def get_default_config():
#     return _post_process(_set_default_config())


import os.path
import unittest
import datetime
from simiki.config import parse_config, get_default_config
            "destination": "destination",
            "keywords": "wiki, simiki, python, \u7ef4\u57fa",
            "root": "/wiki/",
            "source": "source",
            "attach": "attach",
            "theme": "mytheme",
            "themes_dir": "simiki_themes",
            "title": "\u6211\u7684Wiki",
            "url": "http://wiki.tankywoo.com"
        })
        self.config_file = os.path.join(wiki_path, "config_sample.yml")

    def test_parse_config(self):
        config = parse_config(self.config_file)
        self.expected_config.pop('time')
        _date = config.pop('time')
        if hasattr(unittest.TestCase, 'assertIsInstance'):
            self.assertIsInstance(_date, datetime.datetime)
        else:
            assert isinstance(_date, datetime.datetime), \
                '%s is not an instance of %r' % \
                (repr(_date), datetime.datetime)
        self.assertEqual(
            config,
            self.expected_config
        )

    def test_parse_config_not_exist(self):
        not_exist_config_file = os.path.join(self.config_file, "not_exist")
        self.assertRaises(Exception,

# Path: simiki/config.py
# def parse_config(config_file):
#     if not os.path.exists(config_file):
#         raise ConfigFileNotFound("{0} not exists".format(config_file))
# 
#     default_config = _set_default_config()
# 
#     with io.open(config_file, "rt", encoding="utf-8") as fd:
#         config = yaml.load(fd, Loader=yaml.FullLoader)
# 
#     default_config.update(config)
#     config = _post_process(default_config)
# 
#     return config
# 
# def get_default_config():
#     return _post_process(_set_default_config())


# Path: tests/test_parse_config.py
import os.path
import unittest
import datetime
from simiki.config import parse_config, get_default_config

            "destination": "destination",
            "keywords": "wiki, simiki, python, \u7ef4\u57fa",
            "root": "/wiki/",
            "source": "source",
            "attach": "attach",
            "theme": "mytheme",
            "themes_dir": "simiki_themes",
            "title": "\u6211\u7684Wiki",
            "url": "http://wiki.tankywoo.com"
        })
        self.config_file = os.path.join(wiki_path, "config_sample.yml")

    def test_parse_config(self):
        config = parse_config(self.config_file)
        self.expected_config.pop('time')
        _date = config.pop('time')
        if hasattr(unittest.TestCase, 'assertIsInstance'):
            self.assertIsInstance(_date, datetime.datetime)
        else:
            assert isinstance(_date, datetime.datetime), \
                '%s is not an instance of %r' % \
                (repr(_date), datetime.datetime)
        self.assertEqual(
            config,
            self.expected_config
        )

    def test_parse_config_not_exist(self):
        not_exist_config_file = os.path.join(self.config_file, "not_exist")
        self.assertRaises(Exception,

                          lambda: parse_config(not_exist_config_file))