[PATCH libgpiod 2/2] bindings: python: tests: check that event clock is property set in request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>

We currently only have a test-case that checks if the event clock
property is correctly set in the LineSettings object but not whether it
is actually passed to the line request. Extend the existing test-case for
line requests to account for event clocks as well.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
---
 bindings/python/tests/tests_line_request.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bindings/python/tests/tests_line_request.py b/bindings/python/tests/tests_line_request.py
index c79a324..dce5941 100644
--- a/bindings/python/tests/tests_line_request.py
+++ b/bindings/python/tests/tests_line_request.py
@@ -5,7 +5,7 @@ import errno
 import gpiod
 
 from . import gpiosim
-from gpiod.line import Direction, Drive, Edge, Value
+from gpiod.line import Clock, Direction, Drive, Edge, Value
 from unittest import TestCase
 
 Pull = gpiosim.Chip.Pull
@@ -302,12 +302,15 @@ class LineRequestComplexConfig(TestCase):
                         direction=Direction.OUTPUT, output_value=Value.ACTIVE
                     ),
                     (1, 3, 5): gpiod.LineSettings(
-                        direction=Direction.INPUT, edge_detection=Edge.BOTH
+                        direction=Direction.INPUT,
+                        edge_detection=Edge.BOTH,
+                        event_clock=Clock.REALTIME,
                     ),
                 },
             ) as req:
                 self.assertEqual(chip.get_line_info(2).direction, Direction.OUTPUT)
                 self.assertEqual(chip.get_line_info(3).edge_detection, Edge.BOTH)
+                self.assertEqual(chip.get_line_info(5).event_clock, Clock.REALTIME)
 
 
 class LineRequestMixedConfigByName(TestCase):
-- 
2.43.0





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux