Coding style.
- Increase maximum line length from 80 to 100.
This commit is contained in:
parent
4150a9a250
commit
4bf3f994e6
1 changed files with 8 additions and 16 deletions
|
|
@ -20,8 +20,7 @@ _DIMENSIONS = (100, 60)
|
||||||
|
|
||||||
|
|
||||||
def _widget_to_string(widget, dimensions=_DIMENSIONS):
|
def _widget_to_string(widget, dimensions=_DIMENSIONS):
|
||||||
appearance = (widget.appearance_min() if dimensions is None
|
appearance = widget.appearance_min() if dimensions is None else widget.appearance(dimensions)
|
||||||
else widget.appearance(dimensions))
|
|
||||||
return str(fill3.join("\n", appearance))
|
return str(fill3.join("\n", appearance))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,8 +30,7 @@ def _touch(path):
|
||||||
|
|
||||||
def _assert_widget_appearance(widget, golden_path, dimensions=_DIMENSIONS):
|
def _assert_widget_appearance(widget, golden_path, dimensions=_DIMENSIONS):
|
||||||
golden_path_absolute = os.path.join(os.path.dirname(__file__), golden_path)
|
golden_path_absolute = os.path.join(os.path.dirname(__file__), golden_path)
|
||||||
golden.assertGolden(_widget_to_string(widget, dimensions),
|
golden.assertGolden(_widget_to_string(widget, dimensions), golden_path_absolute)
|
||||||
golden_path_absolute)
|
|
||||||
|
|
||||||
|
|
||||||
class _MockMainLoop:
|
class _MockMainLoop:
|
||||||
|
|
@ -65,17 +63,14 @@ class ScreenWidgetTestCase(unittest.TestCase):
|
||||||
_assert_widget_appearance(self.main_widget, "golden-files/help")
|
_assert_widget_appearance(self.main_widget, "golden-files/help")
|
||||||
|
|
||||||
def test_log_appearance(self):
|
def test_log_appearance(self):
|
||||||
_assert_widget_appearance(self.main_widget,
|
_assert_widget_appearance(self.main_widget, "golden-files/log-original")
|
||||||
"golden-files/log-original")
|
|
||||||
self.main_widget.toggle_log()
|
self.main_widget.toggle_log()
|
||||||
_assert_widget_appearance(self.main_widget, "golden-files/log")
|
_assert_widget_appearance(self.main_widget, "golden-files/log")
|
||||||
|
|
||||||
def test_window_orientation(self):
|
def test_window_orientation(self):
|
||||||
_assert_widget_appearance(self.main_widget,
|
_assert_widget_appearance(self.main_widget, "golden-files/window-orientation-original")
|
||||||
"golden-files/window-orientation-original")
|
|
||||||
self.main_widget.toggle_window_orientation()
|
self.main_widget.toggle_window_orientation()
|
||||||
_assert_widget_appearance(self.main_widget,
|
_assert_widget_appearance(self.main_widget, "golden-files/window-orientation")
|
||||||
"golden-files/window-orientation")
|
|
||||||
|
|
||||||
|
|
||||||
class SummaryCursorTest(unittest.TestCase):
|
class SummaryCursorTest(unittest.TestCase):
|
||||||
|
|
@ -126,8 +121,7 @@ class SummarySyncWithFilesystemTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def callback(event):
|
def callback(event):
|
||||||
__main__.on_filesystem_event(event, self.summary, self.temp_dir)
|
__main__.on_filesystem_event(event, self.summary, self.temp_dir)
|
||||||
__main__.setup_inotify(self.temp_dir, self.loop, callback,
|
__main__.setup_inotify(self.temp_dir, self.loop, callback, __main__.is_path_excluded)
|
||||||
__main__.is_path_excluded)
|
|
||||||
_touch(self.foo_path)
|
_touch(self.foo_path)
|
||||||
_touch(self.bar_path)
|
_touch(self.bar_path)
|
||||||
self.log = __main__.Log()
|
self.log = __main__.Log()
|
||||||
|
|
@ -153,8 +147,7 @@ class SummarySyncWithFilesystemTestCase(unittest.TestCase):
|
||||||
self.assertEqual(self.summary.result_total, result_total)
|
self.assertEqual(self.summary.result_total, result_total)
|
||||||
max_width = max((len(row) for row in self.summary._entries), default=0)
|
max_width = max((len(row) for row in self.summary._entries), default=0)
|
||||||
self.assertEqual(__main__.Entry.MAX_WIDTH, max_width)
|
self.assertEqual(__main__.Entry.MAX_WIDTH, max_width)
|
||||||
max_path_length = max(
|
max_path_length = max((len(row.path) - 2 for row in self.summary._entries), default=0)
|
||||||
(len(row.path) - 2 for row in self.summary._entries), default=0)
|
|
||||||
self.assertEqual(self.summary._max_path_length, max_path_length)
|
self.assertEqual(self.summary._max_path_length, max_path_length)
|
||||||
|
|
||||||
def test_summary_initial_state(self):
|
def test_summary_initial_state(self):
|
||||||
|
|
@ -213,8 +206,7 @@ class MainTestCase(unittest.TestCase):
|
||||||
__main__.manage_cache(root_path)
|
__main__.manage_cache(root_path)
|
||||||
with __main__.chdir(root_path):
|
with __main__.chdir(root_path):
|
||||||
with contextlib.redirect_stdout(io.StringIO()):
|
with contextlib.redirect_stdout(io.StringIO()):
|
||||||
__main__.main(root_path, loop, worker_count=2,
|
__main__.main(root_path, loop, worker_count=2, is_being_tested=True)
|
||||||
is_being_tested=True)
|
|
||||||
for file_name in ["summary.pickle", "creation_time",
|
for file_name in ["summary.pickle", "creation_time",
|
||||||
"foo-metadata", "foo-contents"]:
|
"foo-metadata", "foo-contents"]:
|
||||||
self.assertTrue(os.path.exists(".eris/" + file_name))
|
self.assertTrue(os.path.exists(".eris/" + file_name))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue