# Path: qpanel/config.py
# class NotConfigFileQPanel(BaseException):
# class QPanelConfig:
#     def __init__(self, file_path):
#     def __init__(self, path_config_file=None):
#     def __open_config_file(self, file_path):
#     def get_hide_config(self):
#     def get_show_config(self):
#     def __get_entry_ini_default(self, section, var, default):
#     def __get_bool_value_config(self, section, option, default):
#     def __get_entry_int_min_value(self, section, option, min=0):
#     def get(self, section, var):
#     def get_value_set_default(self, section, var, default):
#     def count_element_sections_config(self, section, cfg=None):
#     def has_users(self):
#     def has_user_queues(self):
#     def enable_queue_for_user(self, username, queuename):
#     def queue_enables_for_username(self, username):
#     def has_queuelog_config(self):
#     def has_section(self, section):
#     def is_freeswitch(self):
#     def queues_for_reset_stats(self):
#     def get_items(self, section):
#     def get_theme(self):
#     def realname_queue(self, queuename):


import os
import unittest
from qpanel import config
from shutil import copyfile

    def test_configuration_without_fileconfig(self):
        if ('CI' in os.environ or
                os.path.isfile(self.default_file_config) is False):
            with self.assertRaises(config.NotConfigFileQPanel):
                config.QPanelConfig()

    def test_sample_file_configuration(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, os.pardir, os.pardir,
            os.pardir, 'samples', 'config.ini-dist')

        configuration = config.QPanelConfig()
        self.assertEqual(configuration.port_bind, 5000)

    def test_has_section(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, 'config_default.ini')
        configuration = config.QPanelConfig()
        self.assertEqual(configuration.has_section('general'), True)

    def test_has_no_section(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, 'config_default.ini')
        configuration = config.QPanelConfig()
        self.assertEqual(configuration.has_section('general_not_found'), False)

    def test_default_theme_config(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, 'config_default.ini')

# Path: qpanel/config.py
# class NotConfigFileQPanel(BaseException):
# class QPanelConfig:
#     def __init__(self, file_path):
#     def __init__(self, path_config_file=None):
#     def __open_config_file(self, file_path):
#     def get_hide_config(self):
#     def get_show_config(self):
#     def __get_entry_ini_default(self, section, var, default):
#     def __get_bool_value_config(self, section, option, default):
#     def __get_entry_int_min_value(self, section, option, min=0):
#     def get(self, section, var):
#     def get_value_set_default(self, section, var, default):
#     def count_element_sections_config(self, section, cfg=None):
#     def has_users(self):
#     def has_user_queues(self):
#     def enable_queue_for_user(self, username, queuename):
#     def queue_enables_for_username(self, username):
#     def has_queuelog_config(self):
#     def has_section(self, section):
#     def is_freeswitch(self):
#     def queues_for_reset_stats(self):
#     def get_items(self, section):
#     def get_theme(self):
#     def realname_queue(self, queuename):


# Path: tests/test_config.py
import os
import unittest
from qpanel import config
from shutil import copyfile


    def test_configuration_without_fileconfig(self):
        if ('CI' in os.environ or
                os.path.isfile(self.default_file_config) is False):
            with self.assertRaises(config.NotConfigFileQPanel):
                config.QPanelConfig()

    def test_sample_file_configuration(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, os.pardir, os.pardir,
            os.pardir, 'samples', 'config.ini-dist')

        configuration = config.QPanelConfig()
        self.assertEqual(configuration.port_bind, 5000)

    def test_has_section(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, 'config_default.ini')
        configuration = config.QPanelConfig()
        self.assertEqual(configuration.has_section('general'), True)

    def test_has_no_section(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, 'config_default.ini')
        configuration = config.QPanelConfig()
        self.assertEqual(configuration.has_section('general_not_found'), False)

    def test_default_theme_config(self):
        os.environ["QPANEL_CONFIG_FILE"] = os.path.join(
            self.configs_dir, 'config_default.ini')

        configuration = config.QPanelConfig()