Skip to content

Commit 2266e58

Browse files
cowork-bot: fix ruff format warnings per automated code review
Address formatting issues flagged by automated code review bot on PR #38: - Collapse multi-line runner.invoke() calls that fit within line width - Remove unnecessary line wrapping in assertion expressions - All 167 tests pass
1 parent f19c319 commit 2266e58

1 file changed

Lines changed: 5 additions & 17 deletions

File tree

tests/test_cli.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ def test_convert_output_file(self, tmp_path):
5959
json_file.write_text(json.dumps({"name": "test"}))
6060
out_file = tmp_path / "out.sql"
6161

62-
result = runner.invoke(
63-
app, ["convert", str(json_file), "--output", str(out_file)]
64-
)
62+
result = runner.invoke(app, ["convert", str(json_file), "--output", str(out_file)])
6563
assert result.exit_code == 0
6664
assert out_file.exists()
6765
content = out_file.read_text()
@@ -119,18 +117,14 @@ def test_convert_schema_only_with_flatten(self, tmp_path):
119117
json_file = tmp_path / "nested.json"
120118
json_file.write_text(json.dumps(data))
121119

122-
result = runner.invoke(
123-
app, ["convert", str(json_file), "--schema-only", "--flatten"]
124-
)
120+
result = runner.invoke(app, ["convert", str(json_file), "--schema-only", "--flatten"])
125121
assert result.exit_code == 0
126122
assert "CREATE TABLE" in result.stdout
127123
assert "INSERT INTO" not in result.stdout
128124

129125
def test_convert_stdin(self):
130126
"""Read JSON from stdin."""
131-
result = runner.invoke(
132-
app, ["convert"], input=json.dumps({"name": "stdin_test"})
133-
)
127+
result = runner.invoke(app, ["convert"], input=json.dumps({"name": "stdin_test"}))
134128
assert result.exit_code == 0
135129
assert "'stdin_test'" in result.stdout
136130

@@ -217,11 +211,7 @@ def test_mcp_command_exists(self):
217211
"""mcp command is registered and responds to --help."""
218212
result = runner.invoke(app, ["mcp", "--help"])
219213
assert result.exit_code == 0
220-
assert (
221-
"MCP" in result.stdout
222-
or "Model Context" in result.stdout
223-
or "stdio" in result.stdout
224-
)
214+
assert "MCP" in result.stdout or "Model Context" in result.stdout or "stdio" in result.stdout
225215

226216

227217
class TestCLIErrorHandling:
@@ -265,9 +255,7 @@ def test_convert_boolean_values(self, tmp_path):
265255
json_file.write_text(json.dumps(data))
266256

267257
# Postgres
268-
result = runner.invoke(
269-
app, ["convert", str(json_file), "--dialect", "postgres"]
270-
)
258+
result = runner.invoke(app, ["convert", str(json_file), "--dialect", "postgres"])
271259
assert result.exit_code == 0
272260
assert "TRUE" in result.stdout
273261
assert "FALSE" in result.stdout

0 commit comments

Comments
 (0)