Skip to content

Commit

Permalink
Merge pull request #8 from FilGoodInc/compressed_oxygencs
Browse files Browse the repository at this point in the history
Compressed oxygencs
  • Loading branch information
olry authored Jul 4, 2024
2 parents 9f9fcf2 + 037e677 commit 13b25ef
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 14 deletions.
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Ignore Python cache files
__pycache__
*.pyc
*.pyo

# Ignore Git files
.git
.gitignore

# Ignore Dockerfile and .dockerignore
Dockerfile
.dockerignore

# Ignore local configuration files
*.local
*.log

# Ignore unit test and coverage results
*.coverage
.coverage
.coverage.*

# Ignore pytest cache
.pytest_cache

# Ignore build artifacts
build/
dist/
*.egg-info/
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
with:
context: .
push: true
tags: log680equipe6ete24/myapp:latest,log680equipe6ete24/myapp:${{ github.sha }}
tags: log680equipe6ete24/oxygencs-grp1-eq6:latest,log680equipe6ete24/oxygencs-grp1-eq6:${{ github.sha }}

deploy_docker:
runs-on: ubuntu-latest
Expand All @@ -99,4 +99,4 @@ jobs:
with:
context: .
push: true
tags: log680equipe6ete24/myapp:latest,log680equipe6ete24/myapp:${{ github.sha }}
tags: log680equipe6ete24/oxygencs-grp1-eq6:latest,log680equipe6ete24/oxygencs-grp1-eq6:${{ github.sha }}
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
Expand Down
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# Utiliser une image Python de base
FROM python:3.8-slim

# Définir le répertoire de travail
WORKDIR /app

# Copier les fichiers de l'application
COPY . /app

# Installer les dépendances
RUN pip install --upgrade pip
RUN pip install pipenv
RUN pipenv install --deploy --ignore-pipfile
RUN pip install --upgrade pip \
&& pip install pipenv

RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy --ignore-pipfile

# Copier le fichier .env
COPY .env /app/.env

# Commande pour démarrer l'application
ENV PIPENV_VENV_IN_PROJECT=1
ENV PATH="/app/.venv/bin:$PATH"

CMD ["pipenv", "run", "python", "src/main.py"]
4 changes: 2 additions & 2 deletions test/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def app_instance():
"""Fixture for creating an instance of App."""
app = App()
app._db_connection = MagicMock() # Mock the _db_connection attribute
app._db_connection = MagicMock()
return app


Expand Down Expand Up @@ -40,6 +40,6 @@ def test_save_event_to_database(app_instance):
"""Test the save_event_to_database method."""
with patch.object(
app_instance._db_connection, "cursor", create=True
) as mock_cursor: # pylint: disable=protected-access
) as mock_cursor:
app_instance.save_event_to_database("2023-01-01T00:00:00", 25.0, "TurnOnAc")
mock_cursor.assert_called_once()

0 comments on commit 13b25ef

Please sign in to comment.