# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function

import os
import unittest

import json


class TestConf(unittest.TestCase):
    """
    A TestCase for configutation files.
    """

    def test_defaults_syntax(self):
        """ Test if defaults.conf has correct syntax. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../conf/defaults.conf')) as fhandle:
            json.load(fhandle)

    def test_harmonization_syntax(self):
        """ Test if defaults.conf has correct syntax. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../conf/harmonization.conf')) as fhandle:
            json.load(fhandle)

    def test_pipeline_syntax(self):
        """ Test if defaults.conf has correct syntax. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../conf/pipeline.conf')) as fhandle:
            json.load(fhandle)

    def test_runtime_syntax(self):
        """ Test if defaults.conf has correct syntax. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../conf/runtime.conf')) as fhandle:
            json.load(fhandle)

    def test_startup_syntax(self):
        """ Test if defaults.conf has correct syntax. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../conf/startup.conf')) as fhandle:
            json.load(fhandle)

    def test_system_syntax(self):
        """ Test if defaults.conf has correct syntax. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../conf/system.conf')) as fhandle:
            json.load(fhandle)

    def test_BOTS_syntax(self):
        """ Test if BOTS has correct syntax. """
        with open(os.path.join(os.path.dirname(__file__),
                               '../bots/BOTS')) as fhandle:
            json.load(fhandle)


if __name__ == '__main__':
    unittest.main()

test for config file syntax