Skip to content

Commit e7f59d9

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
1 parent baa4e79 commit e7f59d9

File tree

4 files changed

+32
-34
lines changed

4 files changed

+32
-34
lines changed

app/commands/docs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ def openapi(
2828
"""
2929
openapi_file = Path(prefix, filename)
3030
rprint(
31-
"Generating OpenAPI schema at [bold]"
32-
f"{openapi_file.resolve()}[/bold]\n"
31+
f"Generating OpenAPI schema at [bold]{openapi_file.resolve()}[/bold]\n"
3332
)
3433
with openapi_file.open(mode="w") as f:
3534
json.dump(

app/managers/user.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ async def register(
115115
"user": new_user["email"],
116116
"base_url": get_settings().base_url,
117117
"name": (
118-
f"{new_user['first_name']}"
119-
f"{new_user['last_name']}"
118+
f"{new_user['first_name']}{new_user['last_name']}"
120119
),
121120
"verification": AuthManager.encode_verify_token(
122121
user_do

tests/cli/test_cli_custom_command.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ def test_init_function_with_existing_metadata(self, fs, mocker) -> None:
153153
), "Metadata file does not exist after init."
154154
with open(metadata_file_path) as file: # noqa: PTH123
155155
content = file.read()
156-
assert (
157-
content != original_content
158-
), "Metadata file was not overwritten with default content."
156+
assert content != original_content, (
157+
"Metadata file was not overwritten with default content."
158+
)
159159

160160
def test_init_function_fails_write(self, fs, mocker, capsys) -> None:
161161
"""Test that running 'init' should fail if it cannot write."""
@@ -263,12 +263,12 @@ def test_full_metadata_command(self, runner, fs_setup) -> None:
263263
result = runner.invoke(app, ["custom", "metadata"], input="\n")
264264

265265
# Verify command execution was successful
266-
assert (
267-
result.exit_code == 0
268-
), "The command did not complete successfully"
269-
assert (
270-
"You have entered the following data:" in result.output
271-
), "Expected output was not found"
266+
assert result.exit_code == 0, (
267+
"The command did not complete successfully"
268+
)
269+
assert "You have entered the following data:" in result.output, (
270+
"Expected output was not found"
271+
)
272272

273273
# Verify the contents of metadata.py in the app/config subdirectory
274274
metadata_path = "/home/test/app/config/metadata.py"
@@ -281,23 +281,23 @@ def test_full_metadata_command(self, runner, fs_setup) -> None:
281281
value, dict
282282
): # For nested structures like 'license'
283283
for nested_key, nested_value in value.items():
284-
assert (
285-
str(nested_value) in metadata_contents
286-
), f"{nested_key} was not updated in metadata.py"
284+
assert str(nested_value) in metadata_contents, (
285+
f"{nested_key} was not updated in metadata.py"
286+
)
287287
else:
288-
assert (
289-
str(value) in metadata_contents
290-
), f"{key} was not updated correctly in metadata.py"
288+
assert str(value) in metadata_contents, (
289+
f"{key} was not updated correctly in metadata.py"
290+
)
291291

292292
# Verify the contents of pyproject.toml were updated
293293
with open("/home/test/pyproject.toml") as f: # noqa: PTH123
294294
pyproject_contents = f.read()
295-
assert (
296-
str(self.test_data["version"]) in pyproject_contents
297-
), "pyproject.toml version was not updated correctly"
298-
assert (
299-
str(self.test_data["name"]) in pyproject_contents
300-
), "pyproject.toml title was not updated correctly"
295+
assert str(self.test_data["version"]) in pyproject_contents, (
296+
"pyproject.toml version was not updated correctly"
297+
)
298+
assert str(self.test_data["name"]) in pyproject_contents, (
299+
"pyproject.toml title was not updated correctly"
300+
)
301301

302302
@pytest.mark.skipif(
303303
is_running_in_docker(), reason="This test fails under docker"

tests/unit/test_validation.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ class TestValidateSettings:
1111
def test_api_root_ends_with_slash(self) -> None:
1212
"""A trailing slash should be removed from the api_root."""
1313
settings = Settings(api_root=f"{self.test_root}/")
14-
assert (
15-
settings.api_root == self.test_root
16-
), "api_root should have trailing slash removed"
14+
assert settings.api_root == self.test_root, (
15+
"api_root should have trailing slash removed"
16+
)
1717

1818
def test_api_root_without_trailing_slash(self) -> None:
1919
"""Good api_root should remain unchanged."""
2020
settings = Settings(api_root=self.test_root)
21-
assert (
22-
settings.api_root == self.test_root
23-
), "api_root should remain unchanged"
21+
assert settings.api_root == self.test_root, (
22+
"api_root should remain unchanged"
23+
)
2424

2525
def test_api_root_empty_string(self) -> None:
2626
"""Empty string should be handled correctly."""
2727
settings = Settings(api_root="")
28-
assert (
29-
settings.api_root == ""
30-
), "api_root should handle empty strings correctly"
28+
assert settings.api_root == "", (
29+
"api_root should handle empty strings correctly"
30+
)

0 commit comments

Comments
 (0)