diff --git a/src/covid19/__init__.py b/src/covid19/__init__.py index 546f6be3a04b5266e8de529e2dace132d0d3fa9b..a2b7f3149d3a1a43b0a3df461f39665979c4c16c 100644 --- a/src/covid19/__init__.py +++ b/src/covid19/__init__.py @@ -9,7 +9,5 @@ def run_web(): app.logger.info("# Covid19 Data - WEB #") app.logger.info("#############################################################") app.logger.info(" ") - app.run( - debug=run_run_with_debug, - port=port - ) + app.run(debug=run_run_with_debug, port=port) + diff --git a/src/covid19_worker/__init__.py b/src/covid19_worker/__init__.py index 142e368ec77bed21345ed5059b6a5b439cd8553f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/src/covid19_worker/__init__.py +++ b/src/covid19_worker/__init__.py @@ -1,7 +0,0 @@ -import sys -import subprocess -from covid19 import app -from covid19.blueprints.application.application_workers import celery - - - diff --git a/tests/covid19/blueprints/admin/test_admin_views.py b/tests/covid19/blueprints/admin/test_admin_views.py index 5006fe047b1bae94b57450e083b942cd18fa639c..c56208175ede5703d78e3faea5fcbf284895e894 100644 --- a/tests/covid19/blueprints/admin/test_admin_views.py +++ b/tests/covid19/blueprints/admin/test_admin_views.py @@ -1,15 +1,23 @@ -#from flask import render_template, redirect, url_for, flash, Blueprint -#from celery import states -#from celery.utils.log import get_task_logger import pytest from flask import url_for -import tests.conftest +from unittest import TestCase +from conftest import app, client -def test_url_admin_tasks(client): - assert client.get(url_for('admin.url_admin_tasks')).status_code == 200 +class Test(TestCase): + def __init__(self, client): + self.client = client + self.url_admin_tasks = url_for('admin.url_admin_tasks', _external=True) + self.url_admin_info = url_for('admin.url_admin_info', _external=True) + def test_run_test_01(self): + self.assertTrue(True) -def test_url_admin_info(client): - assert client.get(url_for('admin.url_admin_info')).status_code == 200 + def test_run_test_02(self): + self.assertTrue(True) + def test_url_admin_tasks(self): + assert self.client.get(self.url_admin_tasks).status_code == 200 + + def test_url_admin_info(self): + assert self.client.get(self.url_admin_info).status_code == 200 diff --git a/tests/covid19/blueprints/application/test_application_views.py b/tests/covid19/blueprints/application/test_application_views.py new file mode 100644 index 0000000000000000000000000000000000000000..ce8a5870757d3e9e36535d391f9c5267fbd6902e --- /dev/null +++ b/tests/covid19/blueprints/application/test_application_views.py @@ -0,0 +1,23 @@ +import pytest +from flask import url_for +from unittest import TestCase +from conftest import app, client + + +class Test(TestCase): + def __init__(self, client): + self.client = client + self.url_home = url_for('application.url_home', _external=True) + self.url_root = url_for('application.url_root', _external=True) + + def test_run_test_01(self): + self.assertTrue(True) + + def test_run_test_02(self): + self.assertTrue(True) + + def test_url_home(self): + assert self.client.get(self.url_home).status_code == 200 + + def test_url_root(self): + assert self.client.get(self.url_root).status_code == 200 diff --git a/tests/covid19/blueprints/owid/test_flaskr.py b/tests/covid19/blueprints/owid/test_flaskr.py deleted file mode 100644 index 907a5bd033ca16547052b177d8663157f17e1965..0000000000000000000000000000000000000000 --- a/tests/covid19/blueprints/owid/test_flaskr.py +++ /dev/null @@ -1,24 +0,0 @@ -import logging - -#from src.covid19.blueprints.application.application_services import owid_service -#from src.covid19.blueprints.application.application_workers import celery -#from src.covid19.blueprints.owid.owid_model import OwidDateReported, OwidData -#from src.covid19.blueprints.owid.owid_model_import import OwidImport -#from src.covid19.blueprints.application.application_model_transient import ApplicationPage - -from unittest import TestCase -#from tests.conftest import app - - -class Test(TestCase): - #def test_run_test(self): - # continents = OwidImport.get_continents() - # for continent in continents: - # logging.info(continent) - # self.assertTrue(True) - - def test_run_test_01(self): - self.assertTrue(True) - - def test_run_test_02(self): - self.assertTrue(True) diff --git a/tests/covid19/blueprints/owid/test_owid.py b/tests/covid19/blueprints/owid/test_owid.py new file mode 100644 index 0000000000000000000000000000000000000000..fa423d5f090df3da731f2c323b22880225aad05d --- /dev/null +++ b/tests/covid19/blueprints/owid/test_owid.py @@ -0,0 +1,15 @@ +import pytest +from flask import url_for +from unittest import TestCase +from conftest import app, client + + +class Test(TestCase): + def __init__(self, client): + self.client = client + + def test_run_test_01(self): + self.assertTrue(True) + + def test_run_test_02(self): + self.assertTrue(True) diff --git a/tests/covid19/blueprints/who/test_who_views.py b/tests/covid19/blueprints/who/test_who_views.py index 2b898433dd99f87d24b511161f4ccef8b76a3770..5a335ce9245fbf994dcb23908f7fbdcd3b7ddbd4 100644 --- a/tests/covid19/blueprints/who/test_who_views.py +++ b/tests/covid19/blueprints/who/test_who_views.py @@ -1,17 +1,17 @@ import pytest from flask import url_for -import covid19.blueprints.application.application_views -import tests.conftest +from unittest import TestCase +from conftest import app, client -appctx = None -reqctx = None +class Test(TestCase): + def __init__(self, client): + self.client = client + self.url_admin_tasks = url_for(endpoint='who.url_who_info', _external=True) + self.url_admin_info = url_for(endpoint='who.url_who_info', _external=True) -def test_url_admin_tasks(client): - url = url_for(endpoint='who.url_who_info', _external=True, appctx=appctx, reqctx=reqctx) - assert client.get(url).status_code == 200 + def test_url_admin_tasks(self): + assert self.client.get(self.url_admin_tasks).status_code == 200 - -def test_url_admin_info(client): - url = url_for(endpoint='who.url_who_info', _external=True, appctx=appctx, reqctx=reqctx) - assert client.get(url).status_code == 200 + def test_url_admin_info(self): + assert self.client.get(self.url_admin_info).status_code == 200