Skip to content

Commit

Permalink
Add new test for s3_version_id functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mpacer committed Dec 2, 2019
1 parent f9dadfc commit e348e84
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bookstore/tests/test_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ def test_gen_template_params(self):
)
assert expected == output

def test_gen_template_params_s3_version_id(self):
expected = {
'post_model': {'s3_bucket': 'hello', 's3_key': 'my_key', 's3_version_id': "my_version"},
'clone_api_url': '/api/bookstore/clone',
'redirect_contents_url': '/',
'source_description': "'my_key' version: my_version from the s3 bucket 'hello'",
}
success_handler = self.get_handler('/bookstore/clone?s3_bucket=hello&s3_key=my_key&s3_version_id=my_version')
output = success_handler.construct_template_params(
s3_bucket="hello", s3_object_key="my_key", s3_version_id="my_version"
)
assert expected == output

def test_gen_template_params_base_url(self):
expected = {
'post_model': {'s3_bucket': 'hello', 's3_key': 'my_key', 's3_version_id': None},
Expand Down

0 comments on commit e348e84

Please sign in to comment.