From d45e883f6d6fb4aba8d6689242a8c6e8d85282b3 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 3 Jul 2014 07:41:23 +0200 Subject: [PATCH] Move NormalizeTests to test.utils.test_misc --- .../test/keyinput/test_basekeyparser.py | 21 ------------------- qutebrowser/test/utils/test_misc.py | 18 ++++++++++++++++ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/qutebrowser/test/keyinput/test_basekeyparser.py b/qutebrowser/test/keyinput/test_basekeyparser.py index 91b04306e..a89a8db8e 100644 --- a/qutebrowser/test/keyinput/test_basekeyparser.py +++ b/qutebrowser/test/keyinput/test_basekeyparser.py @@ -54,27 +54,6 @@ def setUpModule(): basekeyparser.logger = Mock() -class NormalizeTests(unittest.TestCase): - - """Test _normalize_keystr method.""" - - def setUp(self): - self.kp = basekeyparser.BaseKeyParser() - - def test_normalize(self): - """Test normalize with some strings.""" - strings = ( - ('Control+x', 'Ctrl+X'), - ('Windows+x', 'Meta+X'), - ('Mod1+x', 'Alt+X'), - ('Mod4+x', 'Meta+X'), - ('Control--', 'Ctrl+-'), - ('Windows++', 'Meta++'), - ) - for orig, repl in strings: - self.assertEqual(self.kp._normalize_keystr(orig), repl, orig) - - class SplitCountTests(unittest.TestCase): """Test the _split_count method. diff --git a/qutebrowser/test/utils/test_misc.py b/qutebrowser/test/utils/test_misc.py index a7ee3b91b..8f29d2685 100644 --- a/qutebrowser/test/utils/test_misc.py +++ b/qutebrowser/test/utils/test_misc.py @@ -479,5 +479,23 @@ class FormatSizeTests(unittest.TestCase): self.assertEqual(utils.format_size(size, base=1000), out, size) +class NormalizeTests(unittest.TestCase): + + """Test _normalize_keystr method.""" + + def test_normalize(self): + """Test normalize with some strings.""" + strings = ( + ('Control+x', 'Ctrl+X'), + ('Windows+x', 'Meta+X'), + ('Mod1+x', 'Alt+X'), + ('Mod4+x', 'Meta+X'), + ('Control--', 'Ctrl+-'), + ('Windows++', 'Meta++'), + ) + for orig, repl in strings: + self.assertEqual(utils.normalize_keystr(orig), repl, orig) + + if __name__ == '__main__': unittest.main()