Пример #1
0
    def test_retrieval_of_setting_using_empty_config(self):

        gitcc_config_path = self.get_path_to("gitcc-empty")

        cfg = GitConfigParser("don't care section", gitcc_config_path)
        cfg.read()

        self.assertFalse(cfg.ignorePrivateFiles())
Пример #2
0
    def test_retrieval_of_relative_users_module_path(self):

        gitcc_config_path = self.get_path_to("gitcc")

        cfg = GitConfigParser("don't care section", gitcc_config_path)
        cfg.read()

        abs_path = os.path.join(_current_dir, "user-config", "users.py")
        self.assertEqual(abs_path, cfg.getUsersModulePath())
Пример #3
0
    def test_retrieval_of_absolute_users_module_path(self):

        gitcc_config_path = self.get_path_to("gitcc-abs")

        cfg = GitConfigParser("don't care section", gitcc_config_path)
        cfg.read()

        abs_path = "/home/user/gitcc/users.py"
        self.assertEqual(abs_path, cfg.getUsersModulePath())
Пример #4
0
    def test_retrieval_of_users_using_empty_config(self):

        gitcc_config_path = self.get_path_to("gitcc-empty")

        cfg = GitConfigParser("don't care section", gitcc_config_path)
        cfg.read()

        users = get_users_module(cfg.getUsersModulePath())

        self.assertEqual(users.users, {})
        self.assertEqual(users.mailSuffix, "")
Пример #5
0
    def test_retrieval_of_users_using_config(self):

        gitcc_config_path = self.get_path_to("gitcc")

        cfg = GitConfigParser("don't care section", gitcc_config_path)
        cfg.read()

        users = get_users_module(cfg.getUsersModulePath())

        self.assertEqual(users.users["charleso"], "Charles O'Farrell")
        self.assertEqual(users.users["jki"], "Jan Kiszka <[email protected]>")
        self.assertEqual(users.mailSuffix, "example.com")