def test_import_of_nonexisting_users_module(self): users_module_path = self.get_path_to("nonexisting.py") users = get_users_module(users_module_path) self.assertEqual(users.users, {}) self.assertEqual(users.mailSuffix, "")
def test_import_of_users_module(self): users_module_path = self.get_path_to("users.py") users = get_users_module(users_module_path) self.assertEqual(users.users["charleso"], "Charles O'Farrell") self.assertEqual(users.users["jki"], "Jan Kiszka <*****@*****.**>") self.assertEqual(users.mailSuffix, "example.com")
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, "")
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 <*****@*****.**>") self.assertEqual(users.mailSuffix, "example.com")
def test_import_of_unspecified_users_module(self): users = get_users_module("") self.assertEqual(users.users, {}) self.assertEqual(users.mailSuffix, "")