search for: asserttrue

Displaying 11 results from an estimated 11 matches for "asserttrue".

Did you mean: assert_true
2016 Feb 12
2
[PATCH] python: tests: use more targeted assert*() functions/checks
...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['release'], cl)) + self.assertIsInstance (self.version['release'], cl)...
2017 May 21
0
[PATCH 2/2] python: unicode decode handler error scheme setter
...a/python/t/test830RHBZ1406906.py b/python/t/test830RHBZ1406906.py index 17b875226..0bb1ac1d0 100644 --- a/python/t/test830RHBZ1406906.py +++ b/python/t/test830RHBZ1406906.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(pat...
2009 May 08
0
[LLVMdev] Suggestion: Support union types in IR
Talin wrote: > Chris Lattner wrote: >> On Dec 30, 2008, at 12:41 PM, Talin wrote: >> >>> I've been thinking about how to represent unions or "disjoint types" >>> in LLVM IR. At the moment, the only way I know to achieve this right >>> now is to create a struct that is as large as the largest type in >>> the union and then
2019 Apr 03
1
[PATCH] Add missing python bindings tests
...l callback_invoked + g = guestfs.GuestFS(python_return_dict=True) + g.add_drive('/dev/null') + g.launch() + + events = guestfs.EVENT_PROGRESS + + eh = g.set_event_callback(callback, events) + g.debug('progress', ['5']) + self.assertTrue(callback_invoked > 0) + + callback_invoked = 0 + g.delete_event_callback(eh) + g.debug('progress', ['5']) + self.assertEqual(callback_invoked, 0) + + g.set_event_callback(callback, events) + g.debug('progress', ['5']) +...
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
2009 May 08
3
[LLVMdev] Suggestion: Support union types in IR
Chris Lattner wrote: > On Dec 30, 2008, at 12:41 PM, Talin wrote: > >> I've been thinking about how to represent unions or "disjoint types" >> in LLVM IR. At the moment, the only way I know to achieve this right >> now is to create a struct that is as large as the largest type in >> the union and then bitcast it to access the fields contained
2011 Feb 21
2
[LLVMdev] A working garbage collector - finally :)
...he tracer can properly distinguish between two states of a union, one state having a traceable object (a String), and the other state containing a non-traceable value (a float): def testCollectUnionLocalVar { var u:String or float = newString("Hello"); tart.gc.GC.collect(); assertTrue(u isa String); assertEq("Hello", typecast[String](u)); u = 1.0; tart.gc.GC.collect(); assertFalse(u isa String); } The heart of the collector is the TraceAction class - which is invoked for each pointer reference. The tracer for the Tart language is written, of course,...
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
...w").close() + + g.copy_in(self.tempdir, "/") + + if sys.version_info >= (3, 0): + with self.assertRaises(UnicodeDecodeError): + g.find("/") # segfault here on Python 3 + elif sys.version_info >= (2, 0): + self.assertTrue( + any(path for path in g.find("/") if non_utf8_fname in path)) -- 2.11.0
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...def test_rint64 (self): - g = guestfs.GuestFS () - - self.assertAlmostEqual (g.internal_test_rint64 ("10"), 10L, places=1) - - self.assertRaises (RuntimeError, g.internal_test_rint64err) - - - def test_rbool (self): - g = guestfs.GuestFS () - - 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_...
2016 Feb 15
1
[PATCH] Start adding return values tests for bindings
...def test_rint64 (self): + g = guestfs.GuestFS () + + self.assertAlmostEqual (g.internal_test_rint64 ("10"), 10L, places=1) + + self.assertRaises (RuntimeError, g.internal_test_rint64err) + + + def test_rbool (self): + g = guestfs.GuestFS () + + 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_...
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