Move NormalizeTests to test.utils.test_misc

This commit is contained in:
Florian Bruhin 2014-07-03 07:41:23 +02:00
parent 9b24ca39ea
commit d45e883f6d
2 changed files with 18 additions and 21 deletions

View File

@ -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.

View File

@ -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()