# HG changeset patch # User Martin Bornhold # Date 2016-08-09 07:22:14 # Node ID 277d7136f8377c3bb1727f9bb4b60c66ab75f6fb # Parent fd4008f7fb0a0081c446537cef32a15156e5a4df tests: Add some test cases for unicode and list separation. diff --git a/rhodecode/tests/config/test_sanitize_settings.py b/rhodecode/tests/config/test_sanitize_settings.py --- a/rhodecode/tests/config/test_sanitize_settings.py +++ b/rhodecode/tests/config/test_sanitize_settings.py @@ -27,14 +27,15 @@ from rhodecode.config.middleware import class TestHelperFunctions(object): @pytest.mark.parametrize('raw, expected', [ - ('true', True), - ('yes', True), - ('on', True), - ('false', False), - ('no', False), - ('off', False), + ('true', True), (u'true', True), + ('yes', True), (u'yes', True), + ('on', True), (u'on', True), + ('false', False), (u'false', False), + ('no', False), (u'no', False), + ('off', False), (u'off', False), ('invalid-bool-value', False), ('invalid-∫øø@-√å@¨€', False), + (u'invalid-∫øø@-√å@¨€', False), ]) def test_bool_setting_helper(self, raw, expected): key = 'dummy-key' @@ -47,6 +48,7 @@ class TestHelperFunctions(object): ('test-string', 'test-string'), ('CaSe-TeSt', 'case-test'), ('test-string-烩€', 'test-string-烩€'), + (u'test-string-烩€', u'test-string-烩€'), ]) def test_string_setting_helper(self, raw, expected): key = 'dummy-key' @@ -58,12 +60,15 @@ class TestHelperFunctions(object): ('', []), ('test', ['test']), ('CaSe-TeSt', ['CaSe-TeSt']), + ('test-string-烩€', ['test-string-烩€']), + (u'test-string-烩€', [u'test-string-烩€']), ('hg git svn', ['hg', 'git', 'svn']), ('hg,git,svn', ['hg', 'git', 'svn']), ('hg, git, svn', ['hg', 'git', 'svn']), ('hg\ngit\nsvn', ['hg', 'git', 'svn']), - ('hg\n git\n svn', ['hg', 'git', 'svn']), - ('test-string-烩€', ['test-string-烩€']), + (' hg\n git\n svn ', ['hg', 'git', 'svn']), + (', hg , git , svn , ', ['', 'hg', 'git', 'svn', '']), + ('cheese,free node,other', ['cheese', 'free node', 'other']), ]) def test_list_setting_helper(self, raw, expected): key = 'dummy-key'