diff options
Diffstat (limited to 'tests/test_editor.py')
| -rw-r--r-- | tests/test_editor.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/test_editor.py b/tests/test_editor.py index cfd4f5ed..8f5d160e 100644 --- a/tests/test_editor.py +++ b/tests/test_editor.py | |||
| @@ -20,37 +20,37 @@ from editor import Editor | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | class EditorTestCase(unittest.TestCase): | 22 | class EditorTestCase(unittest.TestCase): |
| 23 | """Take care of resetting Editor state across tests.""" | 23 | """Take care of resetting Editor state across tests.""" |
| 24 | 24 | ||
| 25 | def setUp(self): | 25 | def setUp(self): |
| 26 | self.setEditor(None) | 26 | self.setEditor(None) |
| 27 | 27 | ||
| 28 | def tearDown(self): | 28 | def tearDown(self): |
| 29 | self.setEditor(None) | 29 | self.setEditor(None) |
| 30 | 30 | ||
| 31 | @staticmethod | 31 | @staticmethod |
| 32 | def setEditor(editor): | 32 | def setEditor(editor): |
| 33 | Editor._editor = editor | 33 | Editor._editor = editor |
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | class GetEditor(EditorTestCase): | 36 | class GetEditor(EditorTestCase): |
| 37 | """Check GetEditor behavior.""" | 37 | """Check GetEditor behavior.""" |
| 38 | 38 | ||
| 39 | def test_basic(self): | 39 | def test_basic(self): |
| 40 | """Basic checking of _GetEditor.""" | 40 | """Basic checking of _GetEditor.""" |
| 41 | self.setEditor(':') | 41 | self.setEditor(":") |
| 42 | self.assertEqual(':', Editor._GetEditor()) | 42 | self.assertEqual(":", Editor._GetEditor()) |
| 43 | 43 | ||
| 44 | 44 | ||
| 45 | class EditString(EditorTestCase): | 45 | class EditString(EditorTestCase): |
| 46 | """Check EditString behavior.""" | 46 | """Check EditString behavior.""" |
| 47 | 47 | ||
| 48 | def test_no_editor(self): | 48 | def test_no_editor(self): |
| 49 | """Check behavior when no editor is available.""" | 49 | """Check behavior when no editor is available.""" |
| 50 | self.setEditor(':') | 50 | self.setEditor(":") |
| 51 | self.assertEqual('foo', Editor.EditString('foo')) | 51 | self.assertEqual("foo", Editor.EditString("foo")) |
| 52 | 52 | ||
| 53 | def test_cat_editor(self): | 53 | def test_cat_editor(self): |
| 54 | """Check behavior when editor is `cat`.""" | 54 | """Check behavior when editor is `cat`.""" |
| 55 | self.setEditor('cat') | 55 | self.setEditor("cat") |
| 56 | self.assertEqual('foo', Editor.EditString('foo')) | 56 | self.assertEqual("foo", Editor.EditString("foo")) |
