From d835b2cae8abc71958b69362162e6a70c3d7ef63 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 08:48:59 +0200 Subject: Adding upstream version 4.6.0. Signed-off-by: Daniel Baumann --- test/unittests/test_cib.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/unittests/test_cib.py (limited to 'test/unittests/test_cib.py') diff --git a/test/unittests/test_cib.py b/test/unittests/test_cib.py new file mode 100644 index 0000000..def915f --- /dev/null +++ b/test/unittests/test_cib.py @@ -0,0 +1,32 @@ +from __future__ import print_function +from __future__ import unicode_literals +# Copyright (C) 2015 Kristoffer Gronlund +# See COPYING for license information. +from crmsh import cibconfig +from lxml import etree +import copy + +factory = cibconfig.cib_factory + + +def setup_function(): + "set up test fixtures" + from crmsh import idmgmt + idmgmt.clear() + + +def teardown_function(): + pass + + +def test_cib_schema_change(): + "Changing the validate-with CIB attribute" + copy_of_cib = copy.copy(factory.cib_orig) + print(etree.tostring(copy_of_cib, pretty_print=True)) + tmp_cib_objects = factory.cib_objects + factory.cib_objects = [] + factory.change_schema("pacemaker-1.1") + factory.cib_objects = tmp_cib_objects + factory._copy_cib_attributes(copy_of_cib, factory.cib_orig) + assert factory.cib_attrs["validate-with"] == "pacemaker-1.1" + assert factory.cib_elem.get("validate-with") == "pacemaker-1.1" -- cgit v1.2.3