Skip to content

Commit

Permalink
fix: applied git pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
azharcodeit committed Jun 11, 2024
1 parent eca204e commit 27999db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ repos:
hooks:
- id: shellcheck
files: ^(?!.*(?:^|/)contrib(?:/|$)).*$
args: ["-x", "--exclude=SC2317,SC2188,SC2143"]
args: ["-x", "--exclude=SC2317,SC2188,SC2143,SC2086,SC1091"]

# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
Expand Down
24 changes: 16 additions & 8 deletions src/backend/tests/test_projects_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ async def test_generate_project_files(db, client, project):
)
assert response.status_code == 200

async def test_update_project(client, admin_user, project):
"""Test update project metadata"""

async def test_update_project(client, admin_user, project):
"""Test update project metadata."""
updated_project_data = {
"project_info": {
"name": f"Updated Test Project {randint(1, 1000000)}",
Expand All @@ -299,19 +299,27 @@ async def test_update_project(client, admin_user, project):
},
}

response = client.put(
f"/projects/{project.id}", json=updated_project_data
)
response = client.put(f"/projects/{project.id}", json=updated_project_data)

if response.status_code != 200:
log.error(response.json())
assert response.status_code == 200

response_data = response.json()
# Assert that project_info in response_data matches updated_project_data
assert response_data["project_info"]["name"] == updated_project_data["project_info"]["name"]
assert response_data["project_info"]["short_description"] == updated_project_data["project_info"]["short_description"]
assert response_data["project_info"]["description"] == updated_project_data["project_info"]["description"]
assert (
response_data["project_info"]["name"]
== updated_project_data["project_info"]["name"]
)
assert (
response_data["project_info"]["short_description"]
== updated_project_data["project_info"]["short_description"]
)
assert (
response_data["project_info"]["description"]
== updated_project_data["project_info"]["description"]
)


if __name__ == "__main__":
"""Main func if file invoked directly."""
Expand Down

0 comments on commit 27999db

Please sign in to comment.