From d5af29df5ad0690179ecfac0d29805d7978e4b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9lio=20Guilherme?= Date: Sat, 26 Oct 2024 23:32:43 +0100 Subject: [PATCH] fix unit test (#155) * Cleanup code (#2905) * clean duplicates * clean duplicates * clean duplicates * clean duplicates * rename function * Refactor TextEdit, WIP * Fix unit tests with language transform * Fix insecure save of tmp file * Set Sonar for banches, update version * Set Sonar for banches, update version * Set Sonar for branches, update version * Separated key commands in TextEdit. Breaks some, TAB functions, Enter.. * Improve keys calls in TextEditor * Improve key use in TextEditor on Windows * Increase utest in TextEditor * Add requests to setup.py * First develop version * Cleanup code (#154) * Refactor TextEdit, WIP * Fix unit tests with language transform * Separated key commands in TextEdit. Breaks some, TAB functions, Enter.. * Delete commented code, renamve arguments * Refactor change_locale * Increase unit tests --- utest/application/test_app_main.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/utest/application/test_app_main.py b/utest/application/test_app_main.py index fcf5b9e2f..c4d9d951d 100644 --- a/utest/application/test_app_main.py +++ b/utest/application/test_app_main.py @@ -230,5 +230,19 @@ def test_replace_std_for_win(self): robotide._replace_std_for_win() +class TestMisc(unittest.TestCase): + + def tearDown(self): + builtins.__import__ = real_import + + def test_get_code(self): + import wx + from robotide.application import RIDE + + main_app = RIDE() + code = main_app._get_language_code() + assert code in (175, wx.LANGUAGE_ENGLISH_WORLD, wx.LANGUAGE_PORTUGUESE) + + if __name__ == '__main__': unittest.main()