Fixed code formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
default_language_version:
|
default_language_version:
|
||||||
python: python3.9
|
python: python3
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.4.0
|
rev: v4.4.0
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import sqlalchemy as sa
|
|||||||
from alembic import op
|
from alembic import op
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = 'b82cd9e2aa6f'
|
revision = "b82cd9e2aa6f"
|
||||||
down_revision = '92793c8a937c'
|
down_revision = "92793c8a937c"
|
||||||
branch_labels = None
|
branch_labels = None
|
||||||
depends_on = None
|
depends_on = None
|
||||||
|
|
||||||
@@ -17,12 +17,12 @@ depends_on = None
|
|||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
"""Perform the upgrade."""
|
"""Perform the upgrade."""
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.add_column('spool', sa.Column('price', sa.Float(), nullable=True))
|
op.add_column("spool", sa.Column("price", sa.Float(), nullable=True))
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
"""Perform the downgrade."""
|
"""Perform the downgrade."""
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.drop_column('spool', 'price')
|
op.drop_column("spool", "price")
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ def test_add_spool_both_used_and_remaining_weight(random_filament: dict[str, Any
|
|||||||
)
|
)
|
||||||
assert result.status_code == 400 # Cannot set both used and remaining weight
|
assert result.status_code == 400 # Cannot set both used and remaining weight
|
||||||
|
|
||||||
|
|
||||||
def test_add_spool_price(random_filament: dict[str, Any]):
|
def test_add_spool_price(random_filament: dict[str, Any]):
|
||||||
"""Test adding a spool to the database."""
|
"""Test adding a spool to the database."""
|
||||||
# Execute
|
# Execute
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ def test_update_spool_both_used_and_remaining_weight(random_filament: dict[str,
|
|||||||
# Clean up
|
# Clean up
|
||||||
httpx.delete(f"{URL}/api/v1/spool/{spool['id']}").raise_for_status()
|
httpx.delete(f"{URL}/api/v1/spool/{spool['id']}").raise_for_status()
|
||||||
|
|
||||||
|
|
||||||
def test_update_spool_price(random_filament: dict[str, Any]):
|
def test_update_spool_price(random_filament: dict[str, Any]):
|
||||||
"""Test updating a spool in the database."""
|
"""Test updating a spool in the database."""
|
||||||
# Setup
|
# Setup
|
||||||
@@ -114,7 +115,6 @@ def test_update_spool_price(random_filament: dict[str, Any]):
|
|||||||
|
|
||||||
# Execute
|
# Execute
|
||||||
price = 25
|
price = 25
|
||||||
last_used = "2023-01-02T12:00:00+02:00"
|
|
||||||
result = httpx.patch(
|
result = httpx.patch(
|
||||||
f"{URL}/api/v1/spool/{spool['id']}",
|
f"{URL}/api/v1/spool/{spool['id']}",
|
||||||
json={
|
json={
|
||||||
@@ -130,6 +130,7 @@ def test_update_spool_price(random_filament: dict[str, Any]):
|
|||||||
# Clean up
|
# Clean up
|
||||||
httpx.delete(f"{URL}/api/v1/spool/{spool['id']}").raise_for_status()
|
httpx.delete(f"{URL}/api/v1/spool/{spool['id']}").raise_for_status()
|
||||||
|
|
||||||
|
|
||||||
def test_update_spool_not_found(random_filament: dict[str, Any]):
|
def test_update_spool_not_found(random_filament: dict[str, Any]):
|
||||||
"""Test updating a spool that does not exist."""
|
"""Test updating a spool that does not exist."""
|
||||||
# Execute
|
# Execute
|
||||||
|
|||||||
Reference in New Issue
Block a user