Calling Line.request() with no keyword arguments leads to an exception
being raised by PyDict_Size(). Add a test-case exposing this bug. It
will be fixed in the subsequent commit.
Reported-by: Jiri Benc <jbenc@upir.cz>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
self.assertEqual(err_ctx.exception.errno, errno.EPERM)
+ def test_request_with_no_kwds(self):
+ with gpiod.Chip(mockup.chip_name(0)) as chip:
+ line = chip.get_line(2)
+ line.request(default_consumer)
+ self.assertTrue(line.is_requested())
+ self.assertEqual(line.direction(), gpiod.Line.DIRECTION_INPUT)
+ line.release()
+ self.assertFalse(line.is_requested())
+
#
# Iterator test cases
#