Displaying 8 results from an estimated 8 matches for "assertisinstance".
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
(easi...
2016 Feb 22
3
[PATCH 1/3] python: tests: refactor to use unittest's discovery
...ass 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.version['extra'], str)
-
-if __name__ == '__main__':
- unittest.main ()
diff...
2016 Feb 12
1
Re: [PATCH] python: tests: use more targeted assert*() functions/checks
On Friday 12 February 2016 17:13:17 Richard W.M. Jones wrote:
> 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 c...
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:
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 valu...
2016 Feb 15
1
[PATCH] Start adding return values tests for bindings
...uot;), ["0", "1", "2", "3", "4"])
+
+ self.assertRaises (RuntimeError, g.internal_test_rstringlisterr)
+
+
+ def test_rstruct (self):
+ g = guestfs.GuestFS ()
+
+ s = g.internal_test_rstruct ("unused")
+ self.assertIsInstance (s, dict)
+ self.assertEqual (s["pv_name"], "pv0")
+
+ self.assertRaises (RuntimeError, g.internal_test_rstructerr)
+
+
+ def test_rstructlist (self):
+ g = guestfs.GuestFS ()
+
+ self.assertEqual (g.internal_test_rstructlist ("0"), [])
+...