summaryrefslogtreecommitdiffstats
path: root/test/unittests/test_objset.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
commitd835b2cae8abc71958b69362162e6a70c3d7ef63 (patch)
tree81052e3d2ce3e1bcda085f73d925e9d6257dec15 /test/unittests/test_objset.py
parentInitial commit. (diff)
downloadcrmsh-d835b2cae8abc71958b69362162e6a70c3d7ef63.tar.xz
crmsh-d835b2cae8abc71958b69362162e6a70c3d7ef63.zip
Adding upstream version 4.6.0.upstream/4.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/unittests/test_objset.py')
-rw-r--r--test/unittests/test_objset.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/unittests/test_objset.py b/test/unittests/test_objset.py
new file mode 100644
index 0000000..cae39ca
--- /dev/null
+++ b/test/unittests/test_objset.py
@@ -0,0 +1,40 @@
+from __future__ import unicode_literals
+# Copyright (C) 2014 Kristoffer Gronlund <kgronlund@suse.com>
+# See COPYING for license information.
+
+
+from crmsh import cibconfig
+
+factory = cibconfig.cib_factory
+
+
+def assert_in(needle, haystack):
+ if needle not in haystack:
+ message = "%s not in %s" % (needle, haystack)
+ raise AssertionError(message)
+
+
+def setup_function():
+ "set up test fixtures"
+ from crmsh import idmgmt
+ idmgmt.clear()
+
+
+def teardown_function():
+ pass
+
+
+def test_nodes_nocli():
+ for n in factory.node_id_list():
+ obj = factory.find_object(n)
+ if obj is not None:
+ assert obj.node is not None
+ assert True == obj.cli_use_validate()
+ assert False == obj.nocli
+
+
+def test_show():
+ setobj = cibconfig.mkset_obj()
+ s = setobj.repr_nopretty()
+ sp = s.splitlines()
+ assert_in("node ha-one", sp[0:3])