X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/4da0851809e024760d3861ff43309125de34157a..bb588073ab286a9f1f8d839ab2cebe13011dd22c:/tests/test_blackd.py diff --git a/tests/test_blackd.py b/tests/test_blackd.py index 5b6461f..5970303 100644 --- a/tests/test_blackd.py +++ b/tests/test_blackd.py @@ -31,7 +31,7 @@ else: @pytest.mark.blackd -class BlackDTestCase(AioHTTPTestCase): # type: ignore[misc] +class BlackDTestCase(AioHTTPTestCase): def test_blackd_main(self) -> None: with patch("blackd.web.run_app"): result = CliRunner().invoke(blackd.main, []) @@ -104,7 +104,7 @@ class BlackDTestCase(AioHTTPTestCase): # type: ignore[misc] @unittest_run_loop async def test_blackd_pyi(self) -> None: - source, expected = read_data("miscellaneous", "stub.pyi") + source, expected = read_data("cases", "stub.py") response = await self.client.post( "/", data=source, headers={blackd.PYTHON_VARIANT_HEADER: "pyi"} ) @@ -114,7 +114,7 @@ class BlackDTestCase(AioHTTPTestCase): # type: ignore[misc] @unittest_run_loop async def test_blackd_diff(self) -> None: diff_header = re.compile( - r"(In|Out)\t\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\.\d\d\d\d\d\d \+\d\d\d\d" + r"(In|Out)\t\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\.\d\d\d\d\d\d\+\d\d:\d\d" ) source, _ = read_data("miscellaneous", "blackd_diff") @@ -240,3 +240,9 @@ class BlackDTestCase(AioHTTPTestCase): # type: ignore[misc] response = await self.client.post("/", data=data) self.assertEqual(await response.text(), expected) self.assertEqual(response.status, 200) + + @unittest_run_loop + async def test_single_character(self) -> None: + response = await self.client.post("/", data="1") + self.assertEqual(await response.text(), "1\n") + self.assertEqual(response.status, 200)