Skip to content

Commit 1bf8e13

Browse files
committed
Fixed Unit, Integration and Harness according to new request and response payload
1 parent f82c600 commit 1bf8e13

File tree

7 files changed

+47
-408
lines changed

7 files changed

+47
-408
lines changed

src/assets/osw-upload.json

Lines changed: 5 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,9 @@
11
{
2-
"messageType": "osw-upload",
3-
"publishedDate": "2023-02-08T08:33:36.267213Z",
2+
"messageId": "c8c76e89f30944d2b2abd2491bd95337",
3+
"messageType": "workflow_identifier",
44
"data": {
5-
"stage": "OSW-Upload",
6-
"request": {
7-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
8-
"collected_by": "6D3E5B8C-FB16-4B6A-9436-72FD24756CC9",
9-
"collection_date": "2022-11-22T09:43:07.978Z",
10-
"collection_method": "manual",
11-
"publication_date": "2022-11-22T09:43:07.978Z",
12-
"data_source": "local",
13-
"polygon": {
14-
"coordinates": [
15-
[
16-
[
17-
77.5873101438346,
18-
12.975857172137523
19-
],
20-
[
21-
77.58650666918095,
22-
12.97272532145334
23-
],
24-
[
25-
77.5869485802404,
26-
12.970219812510848
27-
],
28-
[
29-
77.58739049129997,
30-
12.967792576658127
31-
],
32-
[
33-
77.5886760507459,
34-
12.967753427498707
35-
],
36-
[
37-
77.58911796180547,
38-
12.969123644412946
39-
],
40-
[
41-
77.59016247885529,
42-
12.972921063276544
43-
],
44-
[
45-
77.58984108899386,
46-
12.973429991296015
47-
],
48-
[
49-
77.5904035212514,
50-
12.974995917131267
51-
],
52-
[
53-
77.58863587701325,
54-
12.975074213164191
55-
],
56-
[
57-
77.5873101438346,
58-
12.975857172137523
59-
]
60-
]
61-
]
62-
},
63-
"osw_schema_version": "1.0.0"
64-
},
65-
"meta": {
66-
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/test_upload/valid.zip"
67-
},
68-
"response": {
69-
"success": true,
70-
"message": "File uploaded for the Project Group : 0b41ebc5-350c-42d3-90af-3af4ad3628fb with tdei record id : c8c76e89f30944d2b2abd2491bd95337"
71-
},
72-
"tdei_record_id": "c8c76e89f30944d2b2abd2491bd95337",
73-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
74-
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab"
5+
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/test_upload/valid.zip",
6+
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab",
7+
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb"
758
}
769
}

src/assets/osw-validation.json

Lines changed: 9 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,11 @@
11
{
2-
"messageType": "osw-validation",
3-
"publishedDate": "2023-02-08T08:33:36.267213Z",
4-
"data": {
5-
"stage": "OSW-Validation",
6-
"request": {
7-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
8-
"collected_by": "6D3E5B8C-FB16-4B6A-9436-72FD24756CC9",
9-
"collection_date": "2022-11-22T09:43:07.978Z",
10-
"collection_method": "manual",
11-
"valid_from": "2022-11-22T09:43:07.978Z",
12-
"valid_to": "2022-11-22T09:43:07.978Z",
13-
"data_source": "local",
14-
"polygon": {
15-
"coordinates": [
16-
[
17-
[
18-
77.5873101438346,
19-
12.975857172137523
20-
],
21-
[
22-
77.58650666918095,
23-
12.97272532145334
24-
],
25-
[
26-
77.5869485802404,
27-
12.970219812510848
28-
],
29-
[
30-
77.58739049129997,
31-
12.967792576658127
32-
],
33-
[
34-
77.5886760507459,
35-
12.967753427498707
36-
],
37-
[
38-
77.58911796180547,
39-
12.969123644412946
40-
],
41-
[
42-
77.59016247885529,
43-
12.972921063276544
44-
],
45-
[
46-
77.58984108899386,
47-
12.973429991296015
48-
],
49-
[
50-
77.5904035212514,
51-
12.974995917131267
52-
],
53-
[
54-
77.58863587701325,
55-
12.975074213164191
56-
],
57-
[
58-
77.5873101438346,
59-
12.975857172137523
60-
]
61-
]
62-
]
63-
},
64-
"osw_schema_version": "1.0.0"
65-
},
66-
"meta": {
67-
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/2023%2FFEBRUARY%2F0b41ebc5-350c-42d3-90af-3af4ad3628fb%2Fvalid_c8c76e89f30944d2b2abd2491bd95337.zip",
68-
"isValid": true
69-
},
70-
"response": {
71-
"success": true,
72-
"message": "Validation successful"
73-
},
74-
"tdei_record_id": "c8c76e89f30944d2b2abd2491bd95337",
75-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
76-
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab"
77-
}
2+
"messageId": "c8c76e89f30944d2b2abd2491bd95337",
3+
"messageType": "workflow_identifier",
4+
"data": {
5+
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/test_upload/valid.zip",
6+
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab",
7+
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
8+
"success": true,
9+
"message": ""
10+
}
7811
}

tests/integration_tests/osw_integration.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
# Execute to apply environment variable overrides
1111
load_dotenv()
1212

13-
os.environ['UPLOAD_TOPIC'] = 'temp-upload'
14-
os.environ['UPLOAD_SUBSCRIPTION'] = 'upload-validation-processor'
15-
os.environ['VALIDATION_TOPIC'] = 'temp-validation'
13+
os.environ['VALIDATION_REQ_TOPIC'] = 'temp-upload'
14+
os.environ['VALIDATION_REQ_SUB'] = 'upload-validation-processor'
15+
os.environ['VALIDATION_RES_TOPIC'] = 'temp-validation'
1616

1717
from src.osw_validator import OSWValidator
1818
from python_ms_core import Core
@@ -27,9 +27,9 @@ class TestOSWIntegration(unittest.TestCase):
2727
@classmethod
2828
def setUpClass(cls):
2929
cls.core = Core()
30-
cls.upload_topic_name = os.environ['UPLOAD_TOPIC']
31-
cls.upload_subscription_name = os.environ['UPLOAD_SUBSCRIPTION']
32-
cls.validation_topic_name = os.environ['VALIDATION_TOPIC']
30+
cls.upload_topic_name = os.environ['VALIDATION_REQ_TOPIC']
31+
cls.upload_subscription_name = os.environ['VALIDATION_REQ_SUB']
32+
cls.validation_topic_name = os.environ['VALIDATION_RES_TOPIC']
3333

3434
def setUp(self):
3535
self.test_data = self.read_test_data()

tests/test_harness/run_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020

2121
class Settings(BaseSettings):
22-
publishing_topic_name: str = os.environ.get('UPLOAD_TOPIC', None)
23-
subscription_topic_name: str = os.environ.get('VALIDATION_TOPIC', None)
22+
publishing_topic_name: str = os.environ.get('VALIDATION_REQ_TOPIC', None)
23+
subscription_topic_name: str = os.environ.get('VALIDATION_RES_TOPIC', None)
2424
subscription_name: str = 'test_subscribtion'
2525
container_name: str = os.environ.get('CONTAINER_NAME', 'tdei-storage-test')
2626

Lines changed: 8 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,9 @@
11
{
2-
"stage": "OSW-Validation",
3-
"request": {
4-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
5-
"collected_by": "6D3E5B8C-FB16-4B6A-9436-72FD24756CC9",
6-
"collection_date": "2022-11-22T09:43:07.978Z",
7-
"collection_method": "manual",
8-
"valid_from": "2022-11-22T09:43:07.978Z",
9-
"valid_to": "2022-11-22T09:43:07.978Z",
10-
"data_source": "local",
11-
"polygon": {
12-
"coordinates": [
13-
[
14-
[
15-
77.5873101438346,
16-
12.975857172137523
17-
],
18-
[
19-
77.58650666918095,
20-
12.97272532145334
21-
],
22-
[
23-
77.5869485802404,
24-
12.970219812510848
25-
],
26-
[
27-
77.58739049129997,
28-
12.967792576658127
29-
],
30-
[
31-
77.5886760507459,
32-
12.967753427498707
33-
],
34-
[
35-
77.58911796180547,
36-
12.969123644412946
37-
],
38-
[
39-
77.59016247885529,
40-
12.972921063276544
41-
],
42-
[
43-
77.58984108899386,
44-
12.973429991296015
45-
],
46-
[
47-
77.5904035212514,
48-
12.974995917131267
49-
],
50-
[
51-
77.58863587701325,
52-
12.975074213164191
53-
],
54-
[
55-
77.5873101438346,
56-
12.975857172137523
57-
]
58-
]
59-
]
60-
},
61-
"osw_schema_version": "1.0.0"
62-
},
63-
"meta": {
64-
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/test_upload/invalid.zip"
65-
},
66-
"response": {
67-
"success": true,
68-
"message": "File uploaded for the Project Group : 0b41ebc5-350c-42d3-90af-3af4ad3628fb with tdei record id : c8c76e89f30944d2b2abd2491bd95337"
69-
},
70-
"tdei_record_id": "c8c76e89f30944d2b2abd2491bd95337",
71-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
72-
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab"
73-
}
2+
"messageId": "c8c76e89f30944d2b2abd2491bd95337",
3+
"messageType": "workflow_identifier",
4+
"data": {
5+
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/test_upload/invalid.zip",
6+
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab",
7+
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb"
8+
}
9+
}
Lines changed: 8 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,9 @@
11
{
2-
"stage": "OSW-Validation",
3-
"request": {
4-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
5-
"collected_by": "6D3E5B8C-FB16-4B6A-9436-72FD24756CC9",
6-
"collection_date": "2022-11-22T09:43:07.978Z",
7-
"collection_method": "manual",
8-
"valid_from": "2022-11-22T09:43:07.978Z",
9-
"valid_to": "2022-11-22T09:43:07.978Z",
10-
"data_source": "local",
11-
"polygon": {
12-
"coordinates": [
13-
[
14-
[
15-
77.5873101438346,
16-
12.975857172137523
17-
],
18-
[
19-
77.58650666918095,
20-
12.97272532145334
21-
],
22-
[
23-
77.5869485802404,
24-
12.970219812510848
25-
],
26-
[
27-
77.58739049129997,
28-
12.967792576658127
29-
],
30-
[
31-
77.5886760507459,
32-
12.967753427498707
33-
],
34-
[
35-
77.58911796180547,
36-
12.969123644412946
37-
],
38-
[
39-
77.59016247885529,
40-
12.972921063276544
41-
],
42-
[
43-
77.58984108899386,
44-
12.973429991296015
45-
],
46-
[
47-
77.5904035212514,
48-
12.974995917131267
49-
],
50-
[
51-
77.58863587701325,
52-
12.975074213164191
53-
],
54-
[
55-
77.5873101438346,
56-
12.975857172137523
57-
]
58-
]
59-
]
60-
},
61-
"osw_schema_version": "1.0.0"
62-
},
63-
"meta": {
64-
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/test_upload/valid.zip"
65-
},
66-
"response": {
67-
"success": true,
68-
"message": "File uploaded for the Project Group : 0b41ebc5-350c-42d3-90af-3af4ad3628fb with tdei record id : c8c76e89f30944d2b2abd2491bd95338"
69-
},
70-
"tdei_record_id": "c8c76e89f30944d2b2abd2491bd95338",
71-
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb",
72-
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab"
73-
}
2+
"messageId": "c8c76e89f30944d2b2abd2491bd95337",
3+
"messageType": "workflow_identifier",
4+
"data": {
5+
"file_upload_path": "https://tdeisamplestorage.blob.core.windows.net/osw/test_upload/valid.zip",
6+
"user_id": "c59d29b6-a063-4249-943f-d320d15ac9ab",
7+
"tdei_project_group_id": "0b41ebc5-350c-42d3-90af-3af4ad3628fb"
8+
}
9+
}

0 commit comments

Comments
 (0)