cornflow 2.0.0a11__py3-none-any.whl → 2.0.0a13__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airflow_config/airflow_local_settings.py +1 -1
- cornflow/app.py +8 -3
- cornflow/cli/migrations.py +23 -3
- cornflow/cli/service.py +18 -18
- cornflow/cli/utils.py +16 -1
- cornflow/commands/dag.py +1 -1
- cornflow/config.py +13 -8
- cornflow/endpoints/__init__.py +8 -2
- cornflow/endpoints/alarms.py +66 -2
- cornflow/endpoints/data_check.py +53 -26
- cornflow/endpoints/execution.py +387 -132
- cornflow/endpoints/login.py +81 -63
- cornflow/endpoints/meta_resource.py +11 -3
- cornflow/migrations/versions/999b98e24225.py +34 -0
- cornflow/models/base_data_model.py +4 -32
- cornflow/models/execution.py +2 -3
- cornflow/models/meta_models.py +28 -22
- cornflow/models/user.py +7 -10
- cornflow/schemas/alarms.py +8 -0
- cornflow/schemas/execution.py +2 -1
- cornflow/schemas/query.py +2 -1
- cornflow/schemas/user.py +5 -20
- cornflow/shared/authentication/auth.py +201 -264
- cornflow/shared/const.py +3 -14
- cornflow/shared/databricks.py +5 -1
- cornflow/tests/const.py +2 -0
- cornflow/tests/custom_test_case.py +77 -26
- cornflow/tests/unit/test_actions.py +2 -2
- cornflow/tests/unit/test_alarms.py +55 -1
- cornflow/tests/unit/test_apiview.py +108 -3
- cornflow/tests/unit/test_cases.py +20 -29
- cornflow/tests/unit/test_cli.py +6 -5
- cornflow/tests/unit/test_commands.py +3 -3
- cornflow/tests/unit/test_dags.py +5 -6
- cornflow/tests/unit/test_executions.py +491 -118
- cornflow/tests/unit/test_instances.py +14 -2
- cornflow/tests/unit/test_instances_file.py +1 -1
- cornflow/tests/unit/test_licenses.py +1 -1
- cornflow/tests/unit/test_log_in.py +230 -207
- cornflow/tests/unit/test_permissions.py +8 -8
- cornflow/tests/unit/test_roles.py +48 -10
- cornflow/tests/unit/test_schemas.py +1 -1
- cornflow/tests/unit/test_tables.py +7 -7
- cornflow/tests/unit/test_token.py +19 -5
- cornflow/tests/unit/test_users.py +22 -6
- cornflow/tests/unit/tools.py +75 -10
- {cornflow-2.0.0a11.dist-info → cornflow-2.0.0a13.dist-info}/METADATA +16 -15
- {cornflow-2.0.0a11.dist-info → cornflow-2.0.0a13.dist-info}/RECORD +51 -51
- {cornflow-2.0.0a11.dist-info → cornflow-2.0.0a13.dist-info}/WHEEL +1 -1
- cornflow/endpoints/execution_databricks.py +0 -808
- {cornflow-2.0.0a11.dist-info → cornflow-2.0.0a13.dist-info}/entry_points.txt +0 -0
- {cornflow-2.0.0a11.dist-info → cornflow-2.0.0a13.dist-info}/top_level.txt +0 -0
@@ -16,6 +16,7 @@ from cornflow.tests.const import (
|
|
16
16
|
INSTANCE_URL,
|
17
17
|
INSTANCES_LIST,
|
18
18
|
INSTANCE_PATH,
|
19
|
+
EMPTY_INSTANCE_PATH
|
19
20
|
)
|
20
21
|
from cornflow.tests.custom_test_case import CustomTestCase, BaseTestCases
|
21
22
|
from flask import current_app
|
@@ -35,6 +36,7 @@ class TestInstancesListEndpoint(BaseTestCases.ListFilters):
|
|
35
36
|
return temp
|
36
37
|
|
37
38
|
self.payload = load_file(INSTANCE_PATH)
|
39
|
+
self.payload2 = load_file(EMPTY_INSTANCE_PATH)
|
38
40
|
self.payloads = [load_file(f) for f in INSTANCES_LIST]
|
39
41
|
self.keys_to_check = [
|
40
42
|
"data_hash",
|
@@ -49,6 +51,16 @@ class TestInstancesListEndpoint(BaseTestCases.ListFilters):
|
|
49
51
|
def test_new_instance(self):
|
50
52
|
self.create_new_row(self.url, self.model, self.payload)
|
51
53
|
|
54
|
+
def test_empty_instance(self):
|
55
|
+
"""
|
56
|
+
testing what happend when empty dictionary get saved
|
57
|
+
"""
|
58
|
+
self.create_new_row(self.url, self.model, self.payload2)
|
59
|
+
|
60
|
+
active_rows = self.model.query.filter(self.model.deleted_at == None).all()
|
61
|
+
has_empty_dict = any(getattr(row, "data", None) == {} for row in active_rows)
|
62
|
+
self.assertTrue(has_empty_dict, "Error: Not an empty dicctionary")
|
63
|
+
|
52
64
|
def test_new_instance_missing_info(self):
|
53
65
|
del self.payload["data"]["parameters"]
|
54
66
|
self.create_new_row(
|
@@ -67,7 +79,7 @@ class TestInstancesListEndpoint(BaseTestCases.ListFilters):
|
|
67
79
|
follow_redirects=True,
|
68
80
|
headers={
|
69
81
|
"Content-Type": "application/json",
|
70
|
-
"Authorization": "Bearer
|
82
|
+
"Authorization": f"Bearer {self.token}",
|
71
83
|
},
|
72
84
|
)
|
73
85
|
self.assertEqual(400, response.status_code)
|
@@ -203,7 +215,7 @@ class TestInstancesDataEndpoint(TestInstancesDetailEndpointBase):
|
|
203
215
|
idx = self.create_new_row(self.url, self.model, self.payload)
|
204
216
|
headers = {
|
205
217
|
"Content-Type": "application/json",
|
206
|
-
"Authorization": "Bearer
|
218
|
+
"Authorization": f"Bearer {self.token}",
|
207
219
|
"Accept-Encoding": "gzip",
|
208
220
|
}
|
209
221
|
response = self.client.get(INSTANCE_URL + idx + "/data/", headers=headers)
|