Skip to content

Commit

Permalink
🔨 Update tests files
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePELAMOURGUES committed Nov 20, 2024
1 parent 1e37964 commit ccc252e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 tests/test_*.py --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=tests/Dags_airflow/*
# exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 tests/test_*.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=tests/Dags_airflow/*
- name: Test with pytest
env:
POSTGRES_USER: test_user
Expand Down
3 changes: 1 addition & 2 deletions tests/Dags_airflow/test_knn_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
def test_dag_loaded():
"""Test que le DAG est correctement chargé."""
assert my_dag is not None
assert len(imdb_scraper_dag.tasks) == 1
assert len(my_dag.tasks) == 1
assert my_dag.task_dict['train_model'] is not None


# Test des propriétés basiques du DAG
assert my_dag.dag_id == 'KNN_train_model'
assert my_dag.schedule_interval == '@daily'
assert my_dag.default_args['owner'] == 'airflow'
assert my_dag.default_args['start_date'] == datetime(2024, 11, 15)


def test_create_X():
Expand Down
5 changes: 2 additions & 3 deletions tests/Dags_airflow/test_scrapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
def test_dag_loaded():
"""Test que le DAG est correctement chargé."""
assert dag is not None
assert len(imdb_scraper_dag.tasks) == 3
assert len(dag.tasks) == 3
assert dag.task_dict['scrape_imdb_task'] is not None
assert dag.task_dict['update_movies_task'] is not None
assert dag.task_dict['update_links_task'] is not None
Expand All @@ -18,5 +18,4 @@ def test_dag_loaded():
# Test des propriétés basiques du DAG
assert dag.dag_id == 'imdb_scraper_dag'
assert dag.schedule_interval == '@daily'
assert dag.default_args['owner'] == 'airflow'
assert dag.default_args['start_date'] == datetime(2024, 11, 19)
assert dag.default_args['owner'] == 'airflow'
2 changes: 1 addition & 1 deletion tests/Dags_airflow/test_surprise_svd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ def test_dag_loaded():
assert svd_dag.dag_id == 'SVD_train_and_compare_model'
assert svd_dag.schedule_interval == '@daily'
assert svd_dag.default_args['owner'] == 'airflow'
assert svd_dag.default_args['start_date'] == datetime(2024, 11, 3)


0 comments on commit ccc252e

Please sign in to comment.