Exemplo n.º 1
0
 def test_os_environ_overrides_cert_bundle(self):
     environ = {
         'AWS_CA_BUNDLE': '/path/to/bundle.pem',
     }
     with mock.patch('os.environ', environ):
         parsed_args = FakeParsedArgs(verify_ssl=True)
         globalargs.resolve_types(parsed_args)
         self.assertEqual(parsed_args.verify_ssl, '/path/to/bundle.pem')
Exemplo n.º 2
0
 def test_os_environ_overrides_cert_bundle(self):
     environ = {
         'AWS_CA_BUNDLE': '/path/to/bundle.pem',
     }
     with mock.patch('os.environ', environ):
         parsed_args = FakeParsedArgs(verify_ssl=True)
         globalargs.resolve_types(parsed_args)
         self.assertEqual(parsed_args.verify_ssl, '/path/to/bundle.pem')
Exemplo n.º 3
0
 def test_parse_query_error_message(self):
     # Invalid jmespath expression.
     parsed_args = FakeParsedArgs(query='foo.bar.')
     with self.assertRaises(ValueError):
         globalargs.resolve_types(parsed_args)
         globalargs.resolve_types('query')
Exemplo n.º 4
0
 def test_parse_query(self):
     parsed_args = FakeParsedArgs(query='foo.bar')
     globalargs.resolve_types(parsed_args)
     # Assert that it looks like a jmespath parsed expression.
     self.assertFalse(isinstance(parsed_args.query, six.string_types))
     self.assertTrue(hasattr(parsed_args.query, 'search'))
Exemplo n.º 5
0
 def test_valid_endpoint_url(self):
     parsed_args = FakeParsedArgs(endpoint_url='http://custom-endpoint.com')
     globalargs.resolve_types(parsed_args)
     self.assertEqual(parsed_args.endpoint_url,
                      'http://custom-endpoint.com')
Exemplo n.º 6
0
 def test_invalid_endpoint_url(self):
     # Invalid jmespath expression.
     parsed_args = FakeParsedArgs(endpoint_url='missing-scheme.com')
     with self.assertRaises(ValueError):
         globalargs.resolve_types(parsed_args)
Exemplo n.º 7
0
 def test_parse_verify_ssl_verify_turned_off(self):
     with mock.patch("os.environ", {}):
         parsed_args = FakeParsedArgs(verify_ssl=False)
         globalargs.resolve_types(parsed_args)
         self.assertFalse(parsed_args.verify_ssl)
Exemplo n.º 8
0
 def test_parse_verify_ssl_default_value(self):
     with mock.patch("os.environ", {}):
         parsed_args = FakeParsedArgs(verify_ssl=True)
         globalargs.resolve_types(parsed_args)
         # None, so that botocore can apply it's default logic.
         self.assertIsNone(parsed_args.verify_ssl)
Exemplo n.º 9
0
 def test_parse_query_error_message(self):
     # Invalid jmespath expression.
     parsed_args = FakeParsedArgs(query='foo.bar.')
     with self.assertRaises(ValueError):
         globalargs.resolve_types(parsed_args)
         globalargs.resolve_types('query')
Exemplo n.º 10
0
 def test_parse_query(self):
     parsed_args = FakeParsedArgs(query='foo.bar')
     globalargs.resolve_types(parsed_args)
     # Assert that it looks like a jmespath parsed expression.
     self.assertFalse(isinstance(parsed_args.query, six.string_types))
     self.assertTrue(hasattr(parsed_args.query, 'search'))
Exemplo n.º 11
0
 def test_valid_endpoint_url(self):
     parsed_args = FakeParsedArgs(endpoint_url='http://custom-endpoint.com')
     globalargs.resolve_types(parsed_args)
     self.assertEqual(parsed_args.endpoint_url,
                      'http://custom-endpoint.com')
Exemplo n.º 12
0
 def test_invalid_endpoint_url(self):
     # Invalid jmespath expression.
     parsed_args = FakeParsedArgs(endpoint_url='missing-scheme.com')
     with self.assertRaises(ValueError):
         globalargs.resolve_types(parsed_args)
Exemplo n.º 13
0
 def test_parse_verify_ssl_verify_turned_off(self):
     with mock.patch('os.environ', {}):
         parsed_args = FakeParsedArgs(verify_ssl=False)
         globalargs.resolve_types(parsed_args)
         self.assertFalse(parsed_args.verify_ssl)
Exemplo n.º 14
0
 def test_parse_verify_ssl_default_value(self):
     with mock.patch('os.environ', {}):
         parsed_args = FakeParsedArgs(verify_ssl=True)
         globalargs.resolve_types(parsed_args)
         # None, so that botocore can apply it's default logic.
         self.assertIsNone(parsed_args.verify_ssl)
Exemplo n.º 15
0
 def test_invalid_endpoint_url(self):
     # Invalid endpoint URL
     parsed_args = FakeParsedArgs(endpoint_url='missing-scheme.com')
     with self.assertRaises(ParamValidationError):
         globalargs.resolve_types(parsed_args)