Skip to content

Commit 535b580

Browse files
committed
feat: renamed web functions and tests
1 parent 822dfcb commit 535b580

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

unicorn_web/src/approvals_service/publication_approved.py renamed to unicorn_web/src/approvals_service/publication_approved_event_handler.py

File renamed without changes.

unicorn_web/src/approvals_service/request_approval.py renamed to unicorn_web/src/approvals_service/request_approval_function.py

File renamed without changes.

unicorn_web/src/search_service/property_search.py renamed to unicorn_web/src/search_service/property_search_function.py

File renamed without changes.

unicorn_web/template.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Resources:
8787
Type: AWS::Serverless::Function
8888
Properties:
8989
CodeUri: src/
90-
Handler: search_service.property_search.lambda_handler
90+
Handler: search_service.property_search_function.lambda_handler
9191
Policies:
9292
- DynamoDBReadPolicy:
9393
TableName: !Ref WebTable
@@ -115,7 +115,7 @@ Resources:
115115
Type: AWS::Serverless::Function
116116
Properties:
117117
CodeUri: src/
118-
Handler: approvals_service.request_approval.lambda_handler
118+
Handler: approvals_service.request_approval_function.lambda_handler
119119
Policies:
120120
- EventBridgePutEventsPolicy:
121121
EventBusName: !Sub "{{resolve:ssm:/UniProp/${Stage}/EventBusName}}"
@@ -135,7 +135,7 @@ Resources:
135135
Type: AWS::Serverless::Function
136136
Properties:
137137
CodeUri: src/
138-
Handler: approvals_service.publication_approved.lambda_handler
138+
Handler: approvals_service.publication_approved_event_handler.lambda_handler
139139
Policies:
140140
- DynamoDBWritePolicy:
141141
TableName: !Ref WebTable

unicorn_web/tests/unit/test_approved_event.py renamed to unicorn_web/tests/unit/test_publication_approved_event_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_property_approved(dynamodb, eventbridge, mocker):
1616
apigw_event = load_event('events/property_approved.json')
1717

1818
# Loading function here so that mocking works correctly.
19-
import approvals_service.publication_approved as app
19+
import approvals_service.publication_approved_event_handler as app
2020

2121
# Reload is required to prevent function setup reuse from another test
2222
reload(app)

unicorn_web/tests/unit/test_request_approval.py renamed to unicorn_web/tests/unit/test_request_approval_function.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_valid_event(dynamodb, eventbridge, mocker):
1616
apigw_event = load_event('events/request_approval_event.json')
1717

1818
# Loading function here so that mocking works correctly.
19-
import approvals_service.request_approval as app
19+
import approvals_service.request_approval_function as app
2020

2121
# Reload is required to prevent function setup reuse from another test
2222
reload(app)
@@ -36,7 +36,7 @@ def test_broken_input_event(dynamodb, eventbridge, mocker):
3636
apigw_event = load_event('events/request_approval_bad_input.json')
3737

3838
# Loading function here so that mocking works correctly.
39-
import approvals_service.request_approval as app
39+
import approvals_service.request_approval_function as app
4040

4141
# Reload is required to prevent function setup reuse from another test
4242
reload(app)
@@ -56,7 +56,7 @@ def test_invalid_property_id(dynamodb, eventbridge, mocker):
5656
apigw_event = load_event('events/request_invalid_property_id.json')
5757

5858
# Loading function here so that mocking works correctly.
59-
import approvals_service.request_approval as app
59+
import approvals_service.request_approval_function as app
6060

6161
# Reload is required to prevent function setup reuse from another test
6262
reload(app)
@@ -76,7 +76,7 @@ def test_already_approved(dynamodb, eventbridge, mocker):
7676
apigw_event = load_event('events/request_already_approved.json')
7777

7878
# Loading function here so that mocking works correctly.
79-
import approvals_service.request_approval as app
79+
import approvals_service.request_approval_function as app
8080

8181
# Reload is required to prevent function setup reuse from another test
8282
reload(app)
@@ -96,7 +96,7 @@ def test_property_does_not_exist(dynamodb, eventbridge, mocker):
9696
apigw_event = load_event('events/request_non_existent_property.json')
9797

9898
# Loading function here so that mocking works correctly.
99-
import approvals_service.request_approval as app
99+
import approvals_service.request_approval_function as app
100100

101101
# Reload is required to prevent function setup reuse from another test
102102
reload(app)

unicorn_web/tests/unit/test_search_function.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_search_by_street(dynamodb, eventbridge, mocker):
1616
apigw_event = load_event('events/search_by_street_event.json')
1717

1818
# Loading function here so that mocking works correctly.
19-
import search_service.property_search as app
19+
import search_service.property_search_function as app
2020

2121
# Reload is required to prevent function setup reuse from another test
2222
reload(app)
@@ -40,7 +40,7 @@ def test_search_by_city(dynamodb, eventbridge, mocker):
4040
apigw_event = load_event('events/search_by_city.json')
4141

4242
# Loading function here so that mocking works correctly.
43-
import search_service.property_search as app
43+
import search_service.property_search_function as app
4444

4545
# Reload is required to prevent function setup reuse from another test
4646
reload(app)
@@ -64,7 +64,7 @@ def test_search_full_address(dynamodb, eventbridge, mocker):
6464
apigw_event = load_event('events/search_by_full_address.json')
6565

6666
# Loading function here so that mocking works correctly.
67-
import search_service.property_search as app
67+
import search_service.property_search_function as app
6868

6969
# Reload is required to prevent function setup reuse from another test
7070
reload(app)
@@ -85,7 +85,7 @@ def test_search_full_address_declined(dynamodb, eventbridge, mocker):
8585
apigw_event = load_event('events/search_by_full_address_declined.json')
8686

8787
# Loading function here so that mocking works correctly.
88-
import search_service.property_search as app
88+
import search_service.property_search_function as app
8989

9090
# Reload is required to prevent function setup reuse from another test
9191
reload(app)
@@ -106,7 +106,7 @@ def test_search_full_address_new(dynamodb, eventbridge, mocker):
106106
apigw_event = load_event('events/search_by_full_address_new.json')
107107

108108
# Loading function here so that mocking works correctly.
109-
import search_service.property_search as app
109+
import search_service.property_search_function as app
110110

111111
# Reload is required to prevent function setup reuse from another test
112112
reload(app)
@@ -127,7 +127,7 @@ def test_search_full_address_not_found(dynamodb, eventbridge, mocker):
127127
apigw_event = load_event('events/search_by_full_address_not_found.json')
128128

129129
# Loading function here so that mocking works correctly.
130-
import search_service.property_search as app
130+
import search_service.property_search_function as app
131131

132132
# Reload is required to prevent function setup reuse from another test
133133
reload(app)

0 commit comments

Comments
 (0)