Exemplo n.º 1
0
    def test_specified_config(self):
        """
        If specific config file is given
        """

        cli.add_config(get_config_file())
        self.assertEqual(general_config.hosts, config.general_config.hosts)
Exemplo n.º 2
0
    def test_specified_config_wrong(self):
        """
        Right now tests if it throws a file not found error. Will improve this functionality later
        """

        with self.assertRaises(FileNotFoundError):
            cli.add_config(
                os.path.join(get_helper_directory(), 'test/config.py'))
Exemplo n.º 3
0
    def test_work_directory_config_wrong(self):
        """
        Right now tests if it throws a file not found error. Will improve this functionality later
        """

        os.chdir(os.path.dirname(get_helper_directory()))
        with self.assertRaises(FileNotFoundError):
            cli.add_config('config.py')
        os.chdir(work_dir)
Exemplo n.º 4
0
    def test_work_directory_config(self):
        """
        If default is taken
        """

        os.chdir(get_helper_directory())
        cli.add_config('config.py')
        self.assertEqual(general_config.hosts, config.general_config.hosts)
        os.chdir(work_dir)
Exemplo n.º 5
0
 def test_no_config_in_file(self):
     os.chdir(get_helper_directory())
     with self.assertRaises(ConfigNotInFileException):
         cli.add_config('test.py')
Exemplo n.º 6
0
 def setUpClass(cls):
     cli.add_config(get_config_file())