Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting issues #4

Merged
merged 12 commits into from
Jul 12, 2024
9 changes: 8 additions & 1 deletion .github/workflows/api-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:

runs-on: ubuntu-20.04

strategy:
matrix:
python-version: [3.9]

services:
postgres:
image: postgres:12
Expand All @@ -70,7 +74,7 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -103,6 +107,9 @@ jobs:
build:
# needs: PyTest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.9]
name: Build
steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions submit-api/src/submit_api/resources/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
return created_user, HTTPStatus.CREATED


@cors_preflight('GET, OPTIONS, PATCH, DELETE')
@API.route('/<user_id>', methods=["PATCH", "GET", "OPTIONS", "DELETE"])
@cors_preflight('GET, OPTIONS, PUT, DELETE')
@API.route('/<user_id>', methods=["PUT", "GET", "OPTIONS", "DELETE"])

Check warning on line 56 in submit-api/src/submit_api/resources/user.py

View check run for this annotation

Codecov / codecov/patch

submit-api/src/submit_api/resources/user.py#L55-L56

Added lines #L55 - L56 were not covered by tests
class User(Resource):
"""Resource for managing a single user"""

Expand All @@ -68,7 +68,7 @@
@staticmethod
@cross_origin(origins=allowedorigins())
@auth.require
def patch(user_id):
def put(user_id):

Check warning on line 71 in submit-api/src/submit_api/resources/user.py

View check run for this annotation

Codecov / codecov/patch

submit-api/src/submit_api/resources/user.py#L71

Added line #L71 was not covered by tests
"""Update a user by id."""
user_data = request.get_json()
updated_user = UserService.update_user(user_id, user_data)
Expand Down
16 changes: 1 addition & 15 deletions submit-api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from flask_migrate import Migrate, upgrade
from sqlalchemy import event, text

from api import create_app, setup_jwt_manager
from submit_api import create_app, setup_jwt_manager
from submit_api.auth import jwt as _jwt
from submit_api.models import db as _db

Expand Down Expand Up @@ -136,20 +136,6 @@ def client_id():
return f'client-{_id}'


@pytest.fixture(scope='session', autouse=True)
def auto(docker_services, app):
"""Spin up a keycloak instance and initialize jwt."""
if app.config['USE_TEST_KEYCLOAK_DOCKER']:
docker_services.start('keycloak')
docker_services.wait_for_service('keycloak', 8081)

setup_jwt_manager(app, _jwt)

if app.config['USE_DOCKER_MOCK']:
docker_services.start('proxy')
time.sleep(10)


@pytest.fixture(scope='session')
def docker_compose_files(pytestconfig):
"""Get the docker-compose.yml absolute path."""
Expand Down
29 changes: 0 additions & 29 deletions submit-api/tests/unit/utils/test_notification.py

This file was deleted.

Loading