diff options
author | Jonathan Slenders <jonathan@slenders.be> | 2014-10-02 15:04:27 +0200 |
---|---|---|
committer | Jonathan Slenders <jonathan@slenders.be> | 2014-10-02 15:04:27 +0200 |
commit | 2444d210af912cfb572f1f9a900d574a2e1fcde1 (patch) | |
tree | 6909fa8121742c3a56b89b280d8bd59cfeb34e21 /tests | |
parent | cce0e4d4342e026d7eee1df06efd22a32b938d92 (diff) |
PEP8
Diffstat (limited to 'tests')
-rw-r--r-- | tests/document_tests/__init__.py | 32 | ||||
-rw-r--r-- | tests/inputstream_tests/__init__.py | 2 | ||||
-rw-r--r-- | tests/key_binding_tests/__init__.py | 1 |
3 files changed, 15 insertions, 20 deletions
diff --git a/tests/document_tests/__init__.py b/tests/document_tests/__init__.py index be319d75..8971066d 100644 --- a/tests/document_tests/__init__.py +++ b/tests/document_tests/__init__.py @@ -5,18 +5,15 @@ from prompt_toolkit.line import Document import unittest - class DocumentTest(unittest.TestCase): def setUp(self): self.document = Document( - 'line 1\n' + - 'line 2\n' + - 'line 3\n' + - 'line 4\n', - len( - 'line 1\n' + - 'lin') - ) + 'line 1\n' + + 'line 2\n' + + 'line 3\n' + + 'line 4\n', + len('line 1\n' + 'lin') + ) def test_current_char(self): self.assertEqual(self.document.current_char, 'e') @@ -26,16 +23,16 @@ class DocumentTest(unittest.TestCase): def test_text_after_cursor(self): self.assertEqual(self.document.text_after_cursor, - 'e 2\n' + - 'line 3\n' + - 'line 4\n') + 'e 2\n' + + 'line 3\n' + + 'line 4\n') def test_lines(self): self.assertEqual(self.document.lines, [ - 'line 1', - 'line 2', - 'line 3', - 'line 4', '' ]) + 'line 1', + 'line 2', + 'line 3', + 'line 4', '']) def test_line_count(self): self.assertEqual(self.document.line_count, 5) @@ -59,8 +56,7 @@ class DocumentTest(unittest.TestCase): def test_translate_index_to_position(self): pos = self.document.translate_index_to_position( - len('line 1\nline 2\nlin')) + len('line 1\nline 2\nlin')) self.assertEqual(pos[0], 3) self.assertEqual(pos[1], 3) - diff --git a/tests/inputstream_tests/__init__.py b/tests/inputstream_tests/__init__.py index cb40996b..5f5e1973 100644 --- a/tests/inputstream_tests/__init__.py +++ b/tests/inputstream_tests/__init__.py @@ -52,7 +52,7 @@ class InputStreamTest(unittest.TestCase): self.assertEqual(self.processor.keys[1].data, 'h') def test_special_double_keys(self): - self.stream.feed('\x1b[1;3D') # Should both send escape and left. + self.stream.feed('\x1b[1;3D') # Should both send escape and left. self.assertEqual(len(self.processor.keys), 2) self.assertEqual(self.processor.keys[0].key, Keys.Escape) diff --git a/tests/key_binding_tests/__init__.py b/tests/key_binding_tests/__init__.py index 79c88f80..6508ded6 100644 --- a/tests/key_binding_tests/__init__.py +++ b/tests/key_binding_tests/__init__.py @@ -7,7 +7,6 @@ from prompt_toolkit.inputstream import KeyPress import unittest - class KeyBindingTest(unittest.TestCase): def setUp(self): class Handlers(object): |