Skip to content

Commit 0aaf6c5

Browse files
authored
Merge pull request #989 from JSee98/zipped-order-delivery-963
Updated order delivery config for zipped orders
2 parents 4055dbb + 8a0e672 commit 0aaf6c5

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,5 @@ coverage.xml
2424

2525
# Editors
2626
.vscode/
27-
2827
# Docs build
2928
site

planet/order_request.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ def delivery(archive_type: Optional[str] = None,
199199
if archive_type:
200200
archive_type = specs.validate_archive_type(archive_type)
201201

202+
# for missing archive file name
203+
if archive_filename is None:
204+
archive_filename = "{{name}}_{{order_id}}.zip"
205+
202206
fields = ['archive_type', 'single_archive', 'archive_filename']
203207
values = [archive_type, single_archive, archive_filename]
204208

tests/unit/test_order_request.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,31 @@ def test_delivery():
160160
assert delivery_config == expected
161161

162162

163+
def test_delivery_missing_archive_details():
164+
as3_config = {
165+
'amazon_s3': {
166+
'aws_access_key_id': 'aws_access_key_id',
167+
'aws_secret_access_key': 'aws_secret_access_key',
168+
'bucket': 'bucket',
169+
'aws_region': 'aws_region'
170+
}
171+
}
172+
delivery_config = order_request.delivery(archive_type='zip',
173+
cloud_config=as3_config)
174+
175+
expected = {
176+
'archive_type': 'zip',
177+
'archive_filename': "{{name}}_{{order_id}}.zip",
178+
'amazon_s3': {
179+
'aws_access_key_id': 'aws_access_key_id',
180+
'aws_secret_access_key': 'aws_secret_access_key',
181+
'bucket': 'bucket',
182+
'aws_region': 'aws_region'
183+
}
184+
}
185+
assert delivery_config == expected
186+
187+
163188
def test_amazon_s3():
164189
as3_config = order_request.amazon_s3('aws_access_key_id',
165190
'aws_secret_access_key',

0 commit comments

Comments
 (0)