From 57df3b88b508f29ff3e47af2ba3067eedc27f78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= <lains@archlinux.org> Date: Tue, 10 Mar 2020 11:38:26 +0000 Subject: [PATCH] tests: add test for property_to_value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaÃns <lains@archlinux.org> --- test/test_clib.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_clib.py b/test/test_clib.py index 165a821..ff51c60 100644 --- a/test/test_clib.py +++ b/test/test_clib.py @@ -41,6 +41,17 @@ class TestNameConversion(unittest.TestCase): with self.assertRaises(ctypes.ArgumentError): name = Libevdev.property_to_name("foo") + def test_prop_to_value(self): + value = Libevdev.property_to_value("INPUT_PROP_POINTER") + self.assertEqual(value, 0) + + value = Libevdev.property_to_value("INPUT_PROP_DIRECT") + self.assertEqual(value, 1) + + def test_prop_to_value_invalid(self): + name = Libevdev.property_to_value("foo") + self.assertIsNone(name) + def test_type_to_name(self): name = Libevdev.event_to_name(1) self.assertEqual(name, "EV_KEY") -- GitLab