search for: assertequal

Displaying 16 results from an estimated 16 matches for "assertequal".

Did you mean: assert_equal
2012 Oct 23
0
Get data of Physical Machine
...Ls in Connect creation the values of nodeInfo variables are differents. For example: it's the same machine, but if I run with xen:/// the memory is X and if I run with qemu:///session the memory is Y. Connect conn = new Connect("xen:///", false); NodeInfo nodeInfo = conn.nodeInfo(); assertEquals("nodeInfo.model", "i686", nodeInfo.model); assertEquals("nodeInfo.memory", 3145728, nodeInfo.mhz); assertEquals("nodeInfo.cpus", 16, nodeInfo.cpus); assertEquals("nodeInfo.cpus", 16, nodeInfo.maxCpus()); assertEquals("nodeInfo.nodes", 2,...
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...port guestfs - -if sys.version_info >= (3, 0): - cl = int -else: - cl = long - -class Test080Version (unittest.TestCase): - def setUp (self): - self.g = guestfs.GuestFS (python_return_dict=True) - self.version = self.g.version () - - def test_major (self): - self.assertEqual (self.version['major'], 1) - - def test_minor (self): - self.assertIsInstance (self.version['minor'], cl) - - def test_release (self): - self.assertIsInstance (self.version['release'], cl) - - def test_extra (self): - self.assertIsInstance (self...
2016 May 04
9
[PATCH 0/8] python: PEP 8 fixes
Hi, this series cleans up the Python sources, either static or generated, including also tests, to make them PEP 8 compliant; see https://www.python.org/dev/peps/pep-0008/ and tools like pep8. Almost all the issues reported by pep8 are fixed, reducing the issues from 3818 to 7. The changes should have no effect on the actual code, while it will help Python users with consistency with other
2005 Sep 25
1
Prototype "classes" and inheritance
...initialize: function() { }, method1: function() { this._super_method1.apply(this, arguments); }, method2: function() { this._super_method2(''changed arg''); } }, true); var derived = new Derived(''ctor arg''); assertEqual(''ctor arg'', superInitArgs[0]); derived.method1(''method arg'') assertEqual(''method arg'', method1Args[0]); derived.method2(''method arg'') assertEqual(''changed arg'', method2Args[0]); }}, testOb...
2016 Feb 12
2
[PATCH] python: tests: use more targeted assert*() functions/checks
...y | 9 +-------- 6 files changed, 8 insertions(+), 22 deletions(-) diff --git a/python/t/080-version.py b/python/t/080-version.py index e8e1e25..cda4872 100644 --- a/python/t/080-version.py +++ b/python/t/080-version.py @@ -34,13 +34,13 @@ class Test080Version (unittest.TestCase): self.assertEqual (self.version['major'], 1) def test_minor (self): - self.assertTrue (isinstance (self.version['minor'], cl)) + self.assertIsInstance (self.version['minor'], cl) def test_release (self): - self.assertTrue (isinstance (self.version['relea...
2016 Feb 15
1
[PATCH] Start adding return values tests for bindings
...() + + self.assertTrue (g.internal_test_rbool ("true")) + self.assertFalse (g.internal_test_rbool ("false")) + + self.assertRaises (RuntimeError, g.internal_test_rboolerr) + + + def test_rconststring (self): + g = guestfs.GuestFS () + + self.assertEqual (g.internal_test_rconststring ("test"), "static string") + + self.assertRaises (RuntimeError, g.internal_test_rconststringerr) + + + def test_rconstoptstring (self): + g = guestfs.GuestFS () + + self.assertEqual (g.internal_test_rconstoptstring ("tes...
2019 Apr 03
1
[PATCH] Add missing python bindings tests
...e Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +#) + +import unittest +import guestfs + + +class Test050HandleProperties(unittest.TestCase): + def test_verbose(self): + g = guestfs.GuestFS(python_return_dict=True) + g.set_verbose(1) + self.assertEqual(g.get_verbose(), 1) + g.set_verbose(0) + self.assertEqual(g.get_verbose(), 0) + + def test_autosync(self): + g = guestfs.GuestFS(python_return_dict=True) + g.set_autosync(1) + self.assertEqual(g.get_autosync(), 1) + g.set_autosync(0) + self.assert...
2019 Mar 28
0
[PATCH v2 4/4] OCaml tools: output messages into JSON for machine readable
...gs + os.execvp("./" + exe, args) + + +@skipUnlessHasModule('iso8601') +class TestParseToolsMessages(unittest.TestCase): + def check_json(self, json, typ, msg): + import iso8601 + # Check the type. + jsontype = json.pop("type") + self.assertEqual(jsontype, typ) + # Check the message. + jsonmsg = json.pop("message") + self.assertEqual(jsonmsg, msg) + # Check the timestamp. + jsonts = json.pop("timestamp") + dt = iso8601.parse_date(jsonts) + now = datetime.datetime.now(dt.tz...
2020 Jan 10
8
[PATCH 0/7] Various Python pycodestyle fixes
Fixes the majority of the pycodestyle issues in the Python bindings, leaving only an overly length line in setup.py. Add a simple optional pycodestyle-based test to avoid regressions in the future. Pino Toscano (7): python: PEP 8: adapt empty lines python: PEP 8: adapt whitespaces in lines python: tests: catch specific exception python: tests: improve variable naming python: tests:
2020 Jan 10
9
[PATCH v2 0/8] Various Python pycodestyle fixes
Fixes all the pycodestyle issues in the Python bindings, overring one that does not make sense to change (and it's in setup.py, so almost irrelevant). Add a simple optional pycodestyle-based test to avoid regressions in the future. Pino Toscano (8): python: PEP 8: adapt empty lines python: PEP 8: adapt whitespaces in lines python: tests: catch specific exception python: tests:
2005 Aug 02
1
JavaScript unit testing
...l, do setup stuff }}, teardown: function() { with(this) { // optional, do teardown stuff }}, // example test (all functions starting with ''test'' are considered, well, tests) testBlah: function() { with(this) { // do something ... assertEqual(expected, actual, "optional message"); // see unittest.js for more asserts // do more, assert more... waitForAjax(function() { // helper for ajax calls (because they''re asynchronous), waits for 1 second // asserts ... });...
2019 Mar 28
8
[PATCH v2 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the messages of OCaml tools as JSON to the machine parseable stream. Related, although not strictly needed for this (and thus can be split if requested), is the addition of the fd format for the machine readable stream. Changes from v1: - use Obj.magic to convert int -> Unix.file_descr - add tests Pino Toscano (4):
2017 May 21
0
[PATCH 2/2] python: unicode decode handler error scheme setter
...30RHBZ1406906.py @@ -55,3 +55,9 @@ class Test830RHBZ1406906(unittest.TestCase): elif sys.version_info >= (2, 0): self.assertTrue( any(path for path in g.find("/") if non_utf8_fname in path)) + + # change decoding error handler + self.assertEqual( + guestfs.set_decode_error_handler("surrogateescape"), 'strict') + self.assertTrue( + any(path for path in g.find("/") if non_utf8_fname in path)) -- 2.11.0
2017 May 21
3
[PATCH 0/2] python: improved UTF8 decoding error handling
The Python 3 bindings currently are unable to deal with non UTF8 characters. This series continues what proposed in RHBZ#1406906. A new function 'set_decode_error_handler' allows the User to specify how to deal with decoding errors. The default behaviour will be raising a UnicodeDecodeError. If the handler is changed to 'surrogateescape', non UTF8 characters will be escaped in a
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
...uestfs.GuestFS(python_return_dict=True) + + g.add_drive_scratch(512 * 1024 * 1024) + g.launch() + + g.part_disk("/dev/sda", "mbr") + g.mkfs("ext4", "/dev/sda1") + g.mount("/dev/sda1", "/") + + self.assertEqual(g.find("/"), ['lost+found']) + + # touch file with illegal unicode character + non_utf8_fname = "\udcd4" + open(os.path.join(self.tempdir, non_utf8_fname), "w").close() + + g.copy_in(self.tempdir, "/") + + if sys.ver...
2020 Jul 06
2
failed to compile samba-4.12.5
...drdump_fuzzed_NULL_struct_ntlmssp_CHALLENGE_MESSAGE(none) REASON: Exception: Exception: Traceback (most recent call last): File "/home/alex/workspace/samba-4.12.5/bin/python/samba/tests/blackbox/ndrdump.py", line 427, in test_ndrdump_fuzzed_NULL_struct_ntlmssp_CHALLENGE_MESSAGE self.assertEqual(actual, expected) AssertionError: b"pul[2034 chars].c:904\npush returned Subcontext Error\nvalidate push FAILED\n" != b"pul[2034 chars].c:905\npush returned Subcontext Error\nvalidate push FAILED\n" command: python3 -m samba.subunit.run $LOADLIST samba.tests.blackbox.ndrdump 2&...