From 9c32ca0b4c1a7f195d445592d50905e62c669a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Wed, 22 Aug 2012 09:57:54 -0300 Subject: [PATCH libxklavier] Add testcase for ConfigRec.set_model in test_gi.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mail-Followup-To: Signed-off-by: Manuel QuiƱones --- tests/test_gi.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/test_gi.py b/tests/test_gi.py index 3e6f654..a7337d1 100755 --- a/tests/test_gi.py +++ b/tests/test_gi.py @@ -103,3 +103,30 @@ print(' Layouts:', rec.layouts) print(' Variants:', rec.variants) print(' Options:', rec.options) +print('Changing model to "pc105"...') +original_model = rec.model +rec.set_model("pc105") + +print('Curent configuration:') +rec = Xkl.ConfigRec() +if not rec.get_from_server(engine): + print('Failed to get configuration from server') + sys.exit(1) +print(' Model:', rec.model) +print(' Layouts:', rec.layouts) +print(' Variants:', rec.variants) +print(' Options:', rec.options) + +print('Changing back to original model...') +rec.set_model(original_model) + +print('Curent configuration:') +rec = Xkl.ConfigRec() +if not rec.get_from_server(engine): + print('Failed to get configuration from server') + sys.exit(1) +print(' Model:', rec.model) +print(' Layouts:', rec.layouts) +print(' Variants:', rec.variants) +print(' Options:', rec.options) + -- 1.7.11.4