def test_upload_expires(self):

        # Test max expiry headers

        r = UploadRequest(self.conn, 'test_zip_key.zip', self.dummy_data, 'bucket', expires='max')

        mock = self._mock_adapter(r)

        expected_headers = {
            'x-amz-acl': 'public-read',
            'Content-Type': 'application/zip',
            'Cache-Control': 'max-age=31536000, public'
        }

        mock.should_receive('put').with_args(
            'https://s3.amazonaws.com/bucket/test_zip_key.zip',
            headers=expected_headers,
            data=self.dummy_data,
            auth=self.conn.auth
        ).and_return(self._mock_response()).once()

        r.run()

        # Test number expiry
        r = UploadRequest(self.conn, 'test_zip_key.zip', self.dummy_data, 'bucket', expires=1337)

        mock = self._mock_adapter(r)

        expected_headers = {
            'x-amz-acl': 'public-read',
            'Content-Type': 'application/zip',
            'Cache-Control': 'max-age=1337, public'
        }

        mock.should_receive('put').with_args(
            'https://s3.amazonaws.com/bucket/test_zip_key.zip',
            headers=expected_headers,
            data=self.dummy_data,
            auth=self.conn.auth
        ).and_return(self._mock_response()).once()

        r.run()

        # Test timedelta expiry

        r = UploadRequest(self.conn, 'test_zip_key.zip', self.dummy_data, 'bucket', expires=timedelta(weeks=2))

        mock = self._mock_adapter(r)

        expected_headers = {
            'x-amz-acl': 'public-read',
            'Content-Type': 'application/zip',
            'Cache-Control': 'max-age=1209600, public'
        }

        mock.should_receive('put').with_args(
            'https://s3.amazonaws.com/bucket/test_zip_key.zip',
            headers=expected_headers,
            data=self.dummy_data,
            auth=self.conn.auth
        ).and_return(self._mock_response()).once()

        r.run()
Try to run a module command. On an exception return None.
dataset/ETHPy150Open smore-inc/tinys3/tinys3/tests/test_upload_request.py/TestUploadRequest.test_upload_expires--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/test.py/try_