def get_config(lib_env): """ Returns ACL configuration in dictionary. Format of output: { "target_list": <list of targets>, "group_list": <list og groups>, "role_list": <list of roles>, } lib_env -- LibraryEnvironment """ acl_section = get_acls(lib_env.get_cib(REQUIRED_CIB_VERSION)) return { "target_list": acl.get_target_list(acl_section), "group_list": acl.get_group_list(acl_section), "role_list": acl.get_role_list(acl_section), }
def get_config(lib_env): """ Returns ACL configuration in disctionary. Fromat of output: { "target_list": <list of targets>, "group_list": <list og groups>, "role_list": <list of roles>, } lib_env -- LibraryEnvironment """ cib = lib_env.get_cib(REQUIRED_CIB_VERSION) return { "target_list": acl.get_target_list(cib), "group_list": acl.get_group_list(cib), "role_list": acl.get_role_list(cib), }
def test_success(self, mock_fn): mock_fn.return_value = "returned data" self.assertEqual("returned data", lib.get_target_list("tree")) mock_fn.assert_called_once_with("tree", "acl_target")