From 44b20fb360ad1b7a321dd20f6ba79ace86413e14 Mon Sep 17 00:00:00 2001 From: pdsccode Date: Sun, 7 Jan 2024 13:25:05 +0100 Subject: [PATCH] Fixed code formatting --- .pre-commit-config.yaml | 2 +- .../2023_12_30_0839-b82cd9e2aa6f_added_spool_prices.py | 8 ++++---- tests_integration/tests/spool/test_add.py | 3 ++- tests_integration/tests/spool/test_update.py | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 628d25f..a7d5009 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: python3.9 + python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 diff --git a/migrations/versions/2023_12_30_0839-b82cd9e2aa6f_added_spool_prices.py b/migrations/versions/2023_12_30_0839-b82cd9e2aa6f_added_spool_prices.py index 5b23030..b0f7820 100644 --- a/migrations/versions/2023_12_30_0839-b82cd9e2aa6f_added_spool_prices.py +++ b/migrations/versions/2023_12_30_0839-b82cd9e2aa6f_added_spool_prices.py @@ -8,8 +8,8 @@ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. -revision = 'b82cd9e2aa6f' -down_revision = '92793c8a937c' +revision = "b82cd9e2aa6f" +down_revision = "92793c8a937c" branch_labels = None depends_on = None @@ -17,12 +17,12 @@ depends_on = None def upgrade() -> None: """Perform the upgrade.""" # ### 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 ### def downgrade() -> None: """Perform the downgrade.""" # ### commands auto generated by Alembic - please adjust! ### - op.drop_column('spool', 'price') + op.drop_column("spool", "price") # ### end Alembic commands ### diff --git a/tests_integration/tests/spool/test_add.py b/tests_integration/tests/spool/test_add.py index 817a74d..256913f 100644 --- a/tests_integration/tests/spool/test_add.py +++ b/tests_integration/tests/spool/test_add.py @@ -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 + def test_add_spool_price(random_filament: dict[str, Any]): """Test adding a spool to the database.""" # Execute @@ -196,4 +197,4 @@ def test_add_spool_price(random_filament: dict[str, Any]): "price": 25, }, ) - assert result.status_code == 400 # Cannot set price \ No newline at end of file + assert result.status_code == 400 # Cannot set price diff --git a/tests_integration/tests/spool/test_update.py b/tests_integration/tests/spool/test_update.py index d7dc258..6075d6e 100644 --- a/tests_integration/tests/spool/test_update.py +++ b/tests_integration/tests/spool/test_update.py @@ -99,6 +99,7 @@ def test_update_spool_both_used_and_remaining_weight(random_filament: dict[str, # Clean up httpx.delete(f"{URL}/api/v1/spool/{spool['id']}").raise_for_status() + def test_update_spool_price(random_filament: dict[str, Any]): """Test updating a spool in the database.""" # Setup @@ -114,7 +115,6 @@ def test_update_spool_price(random_filament: dict[str, Any]): # Execute price = 25 - last_used = "2023-01-02T12:00:00+02:00" result = httpx.patch( f"{URL}/api/v1/spool/{spool['id']}", json={ @@ -130,6 +130,7 @@ def test_update_spool_price(random_filament: dict[str, Any]): # Clean up httpx.delete(f"{URL}/api/v1/spool/{spool['id']}").raise_for_status() + def test_update_spool_not_found(random_filament: dict[str, Any]): """Test updating a spool that does not exist.""" # Execute