diff options
author | Gavin Mak <gavinmak@google.com> | 2023-03-11 06:46:20 +0000 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-03-22 17:46:28 +0000 |
commit | ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1 (patch) | |
tree | dc33ba0e56825b3e007d0589891756724725a465 /tests/test_editor.py | |
parent | 1604cf255f8c1786a23388db6d5277ac7949a24a (diff) | |
download | git-repo-ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1.tar.gz |
Format codebase with black and check formatting in CQ
Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught
by flake8. Also check black formatting in run_tests (and CQ).
Bug: b/267675342
Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
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")) |