Coding style.

- Increase maximum line length from 80 to 100.
This commit is contained in:
Andrew Hamilton 2021-11-29 16:02:32 +10:00
parent 4150a9a250
commit 4bf3f994e6

View file

@ -20,8 +20,7 @@ _DIMENSIONS = (100, 60)
def _widget_to_string(widget, dimensions=_DIMENSIONS):
appearance = (widget.appearance_min() if dimensions is None
else widget.appearance(dimensions))
appearance = widget.appearance_min() if dimensions is None else widget.appearance(dimensions)
return str(fill3.join("\n", appearance))
@ -31,8 +30,7 @@ def _touch(path):
def _assert_widget_appearance(widget, golden_path, dimensions=_DIMENSIONS):
golden_path_absolute = os.path.join(os.path.dirname(__file__), golden_path)
golden.assertGolden(_widget_to_string(widget, dimensions),
golden_path_absolute)
golden.assertGolden(_widget_to_string(widget, dimensions), golden_path_absolute)
class _MockMainLoop:
@ -65,17 +63,14 @@ class ScreenWidgetTestCase(unittest.TestCase):
_assert_widget_appearance(self.main_widget, "golden-files/help")
def test_log_appearance(self):
_assert_widget_appearance(self.main_widget,
"golden-files/log-original")
_assert_widget_appearance(self.main_widget, "golden-files/log-original")
self.main_widget.toggle_log()
_assert_widget_appearance(self.main_widget, "golden-files/log")
def test_window_orientation(self):
_assert_widget_appearance(self.main_widget,
"golden-files/window-orientation-original")
_assert_widget_appearance(self.main_widget, "golden-files/window-orientation-original")
self.main_widget.toggle_window_orientation()
_assert_widget_appearance(self.main_widget,
"golden-files/window-orientation")
_assert_widget_appearance(self.main_widget, "golden-files/window-orientation")
class SummaryCursorTest(unittest.TestCase):
@ -126,8 +121,7 @@ class SummarySyncWithFilesystemTestCase(unittest.TestCase):
def callback(event):
__main__.on_filesystem_event(event, self.summary, self.temp_dir)
__main__.setup_inotify(self.temp_dir, self.loop, callback,
__main__.is_path_excluded)
__main__.setup_inotify(self.temp_dir, self.loop, callback, __main__.is_path_excluded)
_touch(self.foo_path)
_touch(self.bar_path)
self.log = __main__.Log()
@ -153,8 +147,7 @@ class SummarySyncWithFilesystemTestCase(unittest.TestCase):
self.assertEqual(self.summary.result_total, result_total)
max_width = max((len(row) for row in self.summary._entries), default=0)
self.assertEqual(__main__.Entry.MAX_WIDTH, max_width)
max_path_length = max(
(len(row.path) - 2 for row in self.summary._entries), default=0)
max_path_length = max((len(row.path) - 2 for row in self.summary._entries), default=0)
self.assertEqual(self.summary._max_path_length, max_path_length)
def test_summary_initial_state(self):
@ -213,8 +206,7 @@ class MainTestCase(unittest.TestCase):
__main__.manage_cache(root_path)
with __main__.chdir(root_path):
with contextlib.redirect_stdout(io.StringIO()):
__main__.main(root_path, loop, worker_count=2,
is_being_tested=True)
__main__.main(root_path, loop, worker_count=2, is_being_tested=True)
for file_name in ["summary.pickle", "creation_time",
"foo-metadata", "foo-contents"]:
self.assertTrue(os.path.exists(".eris/" + file_name))