From e64a121572a642d4314b2b283460540f376b370e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sat, 27 Jul 2019 16:56:19 +1000 Subject: [PATCH] tools: switch the button tests over to json --- tools/ratbagctl.test.in | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tools/ratbagctl.test.in b/tools/ratbagctl.test.in index 98afc7d7..c9c7c22e 100755 --- a/tools/ratbagctl.test.in +++ b/tools/ratbagctl.test.in @@ -526,10 +526,38 @@ class TestRatbagCtlReportRate(TestRatbagCtl): class TestRatbagCtlButton(TestRatbagCtl): + json = ''' + { + "profiles": [ + { "is_active": true, + "buttons": [ + { "button": 0 }, + { "action_type": "none" }, + { "action_type": "special", + "special": "profile-cycle-up" }, + { "action_type": "macro", + "macro": [ "+B", "-B", "t300" ] } + ] + }, + { "is_active": false + }, + { "is_active": false, + "buttons": [ + { "action_type": "special", + "special": "profile-cycle-up" }, + { "action_type": "special" }, + { "button": 2, + "action_type": "button" }, + { "button": 3, + "action_type": "button" } + ] + } + ] + } + ''' @classmethod def setUpClass(cls): super().setUpClass() - cls.setProfile(0) def test_button_count(self): command = "button count"