X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/23fec8b0f73a142d1796c8ca958230ad52d83c24..a02829bea1452e0db150eec88c2d99eaf162aa72:/tests/test_black.py?ds=sidebyside diff --git a/tests/test_black.py b/tests/test_black.py index 93f853b..66aa360 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -778,6 +778,13 @@ class BlackTestCase(unittest.TestCase): "2 files would be reformatted, 3 files would be left unchanged, " "2 files would fail to reformat.", ) + report.check = False + report.diff = True + self.assertEqual( + unstyle(str(report)), + "2 files would be reformatted, 3 files would be left unchanged, " + "2 files would fail to reformat.", + ) def test_report_quiet(self) -> None: report = black.Report(quiet=True) @@ -865,6 +872,13 @@ class BlackTestCase(unittest.TestCase): "2 files would be reformatted, 3 files would be left unchanged, " "2 files would fail to reformat.", ) + report.check = False + report.diff = True + self.assertEqual( + unstyle(str(report)), + "2 files would be reformatted, 3 files would be left unchanged, " + "2 files would fail to reformat.", + ) def test_report_normal(self) -> None: report = black.Report() @@ -955,6 +969,13 @@ class BlackTestCase(unittest.TestCase): "2 files would be reformatted, 3 files would be left unchanged, " "2 files would fail to reformat.", ) + report.check = False + report.diff = True + self.assertEqual( + unstyle(str(report)), + "2 files would be reformatted, 3 files would be left unchanged, " + "2 files would fail to reformat.", + ) def test_lib2to3_parse(self) -> None: with self.assertRaises(black.InvalidInput): @@ -1540,6 +1561,7 @@ class BlackTestCase(unittest.TestCase): # outside of the `root` directory. path.iterdir.return_value = [child] child.resolve.return_value = Path("/a/b/c") + child.as_posix.return_value = "/a/b/c" child.is_symlink.return_value = True try: list(