Skip to content
Snippets Groups Projects
test_config.py 943 B
"""Tests of the config module"""
import unittest
from os.path import dirname, join

from odoo_scripts.config import Configuration


class ConfigTestCase(unittest.TestCase):
    """Tests of the config module"""

    def test_no_conf(self):
        """Test when there is no configuration file"""
        configuration = Configuration(join(dirname(__file__), "config-no-file/"))
        self.assertEqual(configuration.modules, [])

    def test_empty_conf(self):
        """Test when there is no configuration file"""
        configuration = Configuration(join(dirname(__file__), "config-empty/"))
        self.assertEqual(configuration.modules, [])

    def test_simple_conf(self):
        """Test when there is a configuration file with a couple modules"""
        configuration = Configuration(join(dirname(__file__), "config-modules/"))
        self.assertEqual(3, len(configuration.modules))


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