File tree Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,4 @@ pytest-mock==2.0.0
12
12
Faker==4.0.2
13
13
14
14
# Coverage
15
- coverage==4.5.1
16
-
17
- # The Debug Toolbar
18
- Flask-DebugToolbar==0.11.0
15
+ coverage==4.5.1
Original file line number Diff line number Diff line change @@ -28,4 +28,7 @@ SQLAlchemy-Utils==0.36.3
28
28
flask_sqlalchemy==2.4.1
29
29
30
30
# Handling requests
31
- requests==2.23.0
31
+ requests==2.23.0
32
+
33
+ # The Debug Toolbar
34
+ Flask-DebugToolbar==0.11.0
Original file line number Diff line number Diff line change 5
5
from flask_restplus ._http import HTTPStatus
6
6
from pytest_mock import MockFixture
7
7
8
+ unexpected_errors_to_be_handled = [pyodbc .OperationalError ]
9
+
8
10
9
11
def test_app_exists (app ):
10
12
assert app is not None
11
13
12
14
13
- unexpected_errors_to_be_handled = [pyodbc .OperationalError ]
14
-
15
-
16
15
@pytest .mark .parametrize ("error_type" , unexpected_errors_to_be_handled )
17
16
def test_exceptions_are_handled (error_type , client : FlaskClient , mocker : MockFixture ):
18
17
from time_tracker_api .time_entries .time_entries_namespace import time_entries_dao
Original file line number Diff line number Diff line change 2
2
3
3
from time_tracker_api .security import generate_dev_secret_key
4
4
5
+ DISABLE_STR_VALUES = ("false" , "0" , "disabled" )
6
+
5
7
6
8
class Config :
7
9
SECRET_KEY = generate_dev_secret_key ()
@@ -32,13 +34,14 @@ class TestConfig(SQLConfig):
32
34
33
35
34
36
class ProductionConfig (Config ):
35
- DEBUG = False
37
+ DEBUG = os . environ . get ( 'DEBUG' , "false" ). lower () not in DISABLE_STR_VALUES
36
38
FLASK_DEBUG = True
37
39
FLASK_ENV = 'production'
38
40
39
41
40
42
class AzureConfig (SQLConfig ):
41
- DATABASE_URI = os .environ .get ('SQLAZURECONNSTR_DATABASE_URI' )
43
+ DATABASE_URI = os .environ .get ('DATABASE_URI' , os .environ .get ('SQLAZURECONNSTR_DATABASE_URI' ))
44
+ SQLALCHEMY_DATABASE_URI = DATABASE_URI
42
45
43
46
44
47
class AzureDevelopmentConfig (DevelopmentConfig , AzureConfig ):
You can’t perform that action at this time.
0 commit comments