def test_nested_hierarchy_with_no_subsection_parsing(self): filename = path('aws_config_nested') raw_config = raw_config_parse(filename, False)['default'] self.assertEqual(raw_config['aws_access_key_id'], 'foo') self.assertEqual(raw_config['region'], 'us-west-2') # Specifying False for pase_subsections in raw_config_parse # will make sure that indented sections such as singature_version # will not be treated as another subsection but rather # its literal value. self.assertEqual(raw_config['cloudwatch'], '\nsignature_version = v4') self.assertEqual( raw_config['s3'], '\nsignature_version = s3v4' '\naddressing_style = path')
def test_config(self): loaded_config = raw_config_parse(path('aws_config')) self.assertIn('default', loaded_config) self.assertIn('profile "personal"', loaded_config)
def test_config_not_found(self): with self.assertRaises(ibm_botocore.exceptions.ConfigNotFound): loaded_config = raw_config_parse(path('aws_config_notfound'))
def test_config_parse_error(self): filename = path('aws_config_bad') with self.assertRaises(ibm_botocore.exceptions.ConfigParseError): raw_config_parse(filename)
def test_config_parse_error_filesystem_encoding_none(self): filename = path('aws_config_bad') with mock.patch('sys.getfilesystemencoding') as encoding: encoding.return_value = None with self.assertRaises(ibm_botocore.exceptions.ConfigParseError): raw_config_parse(filename)