search for: internal_test_rhasht

Displaying 8 results from an estimated 8 matches for "internal_test_rhasht".

2016 Feb 15
1
[PATCH] Start adding return values tests for bindings
...est_rstructerr'); - -v = g.internal_test_rstructlist('5'); -eq = v.length == 5; -for (var i = 0; eq && i < 5; i++) { - if (v[i].pv_size != i) eq = false; -} -eq || eq_fail('internal_test_rstructlist', v); -check_error('internal_test_rstructlisterr'); - -v = g.internal_test_rhashtable('5'); -eq = true; -for (var i = 0; eq && i < 5; i++) { - if (v[i] != i) eq = false; -} -eq || eq_fail('internal_test_rhashtable', v); -check_error('internal_test_rhashtableerr'); - -v = g.internal_test_rbufferout("01234"); -eq = v.length == 5; -for...
2016 Feb 12
2
[PATCH] python: tests: use more targeted assert*() functions/checks
- use assertIsInstance, assertNotEqual, and assertIsNotNone as more specific checks (will produce better logging) - use assertRaises when expecting exceptions being thrown - when testing internal_test_rhashtable, instead of checking type and elements of the return values just check the return value as a whole (easier and already getting all the work needed by unittest) --- python/t/080-version.py | 6 +++--- python/t/420-log-messages.py | 2 +- python/t/800-explicit-close.py | 6 +----- p...
2016 Feb 12
1
Re: [PATCH] python: tests: use more targeted assert*() functions/checks
...te: > On Fri, Feb 12, 2016 at 06:04:47PM +0100, Pino Toscano wrote: > > - use assertIsInstance, assertNotEqual, and assertIsNotNone as more > > specific checks (will produce better logging) > > - use assertRaises when expecting exceptions being thrown > > - when testing internal_test_rhashtable, instead of checking type and > > elements of the return values just check the return value as a whole > > (easier and already getting all the work needed by unittest) > > Good find! I was going by the documentation which didn't mention any > of these asserts. Hm...
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...e (l[i], dict) - self.assertEqual (l[i]["pv_name"], "pv%d" % i) - - self.assertRaises (RuntimeError, g.internal_test_rstructlisterr) - - - def test_rhashtable_list (self): - g = guestfs.GuestFS (python_return_dict=False) - - self.assertEqual (g.internal_test_rhashtable ("0"), []) - r = g.internal_test_rhashtable ("5") - self.assertEqual (r, [ ("0","0"), ("1","1"), ("2","2"), - ("3","3"), ("4","4")...
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
2016 Feb 12
0
Re: [PATCH] python: tests: use more targeted assert*() functions/checks
On Fri, Feb 12, 2016 at 06:04:47PM +0100, Pino Toscano wrote: > - use assertIsInstance, assertNotEqual, and assertIsNotNone as more > specific checks (will produce better logging) > - use assertRaises when expecting exceptions being thrown > - when testing internal_test_rhashtable, instead of checking type and > elements of the return values just check the return value as a whole > (easier and already getting all the work needed by unittest) Good find! I was going by the documentation which didn't mention any of these asserts. ACK, assuming it also works...
2017 May 04
4
[PATCH 0/3] generator: Allow returned strings to be annotated as devices.
If we want to permit more than 255 drives to be added, then we will have to add the disks to the same virtio-scsi target using different unit (LUN) numbers. Unfortunately SCSI LUN enumeration in the Linux is not deterministic (eg. two disks with target=0, lun=[0,1] can be enumerated as /dev/sda or /dev/sdb randomly). Dealing with that will require some very complex device name translation on the
2017 Feb 18
8
[PATCH 0/6] generator: Split up generator/actions.ml
Split up the huge generator/actions.ml into several smaller files. Rich.