Skip to content

Commit

Permalink
Dockerfile Migrated
Browse files Browse the repository at this point in the history
Tests Renamed
Configtemplate Modified
  • Loading branch information
JohnGrubba committed Jul 19, 2024
1 parent f10bab5 commit a8436ca
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 26 deletions.
4 changes: 1 addition & 3 deletions config/configtemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"conf_code_complexity": 1,
"enable_welcome_email": false,
"oauth": {
"providers_enabled": [
"google"
],
"providers_enabled": [],
"base_url": "http://localhost:3250/"
}
},
Expand Down
5 changes: 3 additions & 2 deletions src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ FROM python:3.12-slim

WORKDIR /src/app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

COPY ./requirements.txt /src/app/requirements.txt
RUN apt update
RUN apt install git -y
RUN pip install --upgrade pip
RUN pip install --no-cache-dir --upgrade -r /src/app/requirements.txt

COPY . /src/app
Expand Down
21 changes: 21 additions & 0 deletions src/api/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import pytest
import datetime
import bcrypt
from tools import users_collection


@pytest.fixture
def fixtureuser() -> dict:
users_collection.find_one_and_delete({"email": "[email protected]"})
hashed_pswd = bcrypt.hashpw("Kennwort1!".encode("utf-8"), bcrypt.gensalt(5)).decode(
"utf-8"
)
user_data = {
"password": hashed_pswd,
"email": "[email protected]",
"username": "FixtureUser",
"createdAt": datetime.datetime.now(),
}
users_collection.insert_one(user_data)
user_data["password"] = "Kennwort1!"
return user_data
21 changes: 0 additions & 21 deletions src/api/test_login.py → src/api/login_test.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
import pytest
import datetime
import bcrypt
from tools import users_collection
from fastapi.testclient import TestClient

from .main import app

client = TestClient(app)


@pytest.fixture
def fixtureuser() -> dict:
users_collection.find_one_and_delete({"email": "[email protected]"})
hashed_pswd = bcrypt.hashpw("Kennwort1!".encode("utf-8"), bcrypt.gensalt(5)).decode(
"utf-8"
)
user_data = {
"password": hashed_pswd,
"email": "[email protected]",
"username": "FixtureUser",
"createdAt": datetime.datetime.now(),
}
users_collection.insert_one(user_data)
user_data["password"] = "Kennwort1!"
return user_data


# SUCCESSFUL TESTS
def test_login_email_identifier(fixtureuser):
response = client.post(
Expand Down
File renamed without changes.
Empty file added src/api/profile_test.py
Empty file.
File renamed without changes.

0 comments on commit a8436ca

Please sign in to comment.