test_s3_file_uploader_wrong_region.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright (c) 2020, Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License").
5 # You may not use this file except in compliance with the License.
6 # A copy of the License is located at
7 #
8 # http://aws.amazon.com/apache2.0
9 #
10 # or in the "license" file accompanying this file. This file is distributed
11 # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 # express or implied. See the License for the specific language governing
13 # permissions and limitations under the License.
14 
15 import sys
16 
17 import rostest
18 
19 from file_helpers import create_temp_file
20 from s3_file_uploader_test_base import S3FileUploaderTestBase
21 
22 PKG = 'rosbag_uploader_ros1_integration_tests'
23 NAME = 'test_s3_file_uploader_wrong_region'
24 AWS_REGION = 'eu-west-1'
25 INCORRECT_REGION_RESULT_CODE = 100 # Currently incorrect region returns UNKNOWN(100)
26 
28  @classmethod
30  return AWS_REGION
31 
34  temp_file_name = create_temp_file()
35  self.files_to_delete.append(temp_file_name)
36  result = self._upload_temp_files([temp_file_name])
37  self.assertFalse(result.result_code.success)
38  self.assertEqual(result.result_code.error_code, INCORRECT_REGION_RESULT_CODE,
39  "Result code was %d" % result.result_code.error_code)
40 
41 if __name__ == '__main__':
42  rostest.rosrun(PKG, NAME, TestS3FileUploaderWrongRegion, sys.argv)
def create_temp_file()
Definition: file_helpers.py:27


integ_tests
Author(s): AWS RoboMaker
autogenerated on Tue Jun 1 2021 02:51:32