示例#1
0
 def test_read_aws_config_default_full(self):
     s = StringIO('\n'.join([
         '[default]',
         'aws_access_key_id = abcdefghijklmnopqrstuvwxyz',
         'aws_secret_access_key=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
         'bucket = bucket-name',
         'region= ap-northeast-1',
     ]))
     self.assertEqual(Settings._read_aws_config(s, 'mogproject'),
                      ('abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bucket-name', 'ap-northeast-1'))
示例#2
0
 def test_read_aws_config_default_full(self):
     s = StringIO('\n'.join([
         '[default]',
         'aws_access_key_id = abcdefghijklmnopqrstuvwxyz',
         'aws_secret_access_key=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
         'bucket = bucket-name',
         'region= ap-northeast-1',
     ]))
     self.assertEqual(Settings._read_aws_config(s, 'mogproject'),
                      ('abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bucket-name', 'ap-northeast-1'))
示例#3
0
 def test_read_config_fallback(self):
     s = StringIO('\n'.join([
         '[default]',
         'aws_access_key_id = abcdefghijklmnopqrstuvwxyz',
         'aws_secret_access_key=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
         'bucket = bucket-name',
         '[my.group.id]',
         'aws_access_key_id = zyxwvutsrqponmlkjihgfedcba',
         'aws_secret_access_key=ZYXWVUTSRQPONMLKJIHGFEDCBA',
         'bucket = bucket-name-123',
     ]))
     self.assertEqual(Settings._read_aws_config(s, 'mogproject'),
                      ('abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bucket-name', None))
示例#4
0
 def test_read_config_fallback(self):
     s = StringIO('\n'.join([
         '[default]',
         'aws_access_key_id = abcdefghijklmnopqrstuvwxyz',
         'aws_secret_access_key=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
         'bucket = bucket-name',
         '[my.group.id]',
         'aws_access_key_id = zyxwvutsrqponmlkjihgfedcba',
         'aws_secret_access_key=ZYXWVUTSRQPONMLKJIHGFEDCBA',
         'bucket = bucket-name-123',
     ]))
     self.assertEqual(Settings._read_aws_config(s, 'mogproject'),
                      ('abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'bucket-name', None))
示例#5
0
 def test_read_aws_config_non_default_full(self):
     s = StringIO('\n'.join([
         '[default]',
         'aws_access_key_id = abcdefghijklmnopqrstuvwxyz',
         'aws_secret_access_key=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
         'bucket = bucket-name',
         'region= ap-northeast-1',
         '[my.group.id]',
         'aws_access_key_id = zyxwvutsrqponmlkjihgfedcba',
         'aws_secret_access_key=ZYXWVUTSRQPONMLKJIHGFEDCBA',
         'bucket = bucket-name-123',
         'region= us-west-1',
     ]))
     self.assertEqual(Settings._read_aws_config(s, 'my.group.id'),
                      ('zyxwvutsrqponmlkjihgfedcba', 'ZYXWVUTSRQPONMLKJIHGFEDCBA', 'bucket-name-123', 'us-west-1'))
示例#6
0
 def test_read_aws_config_non_default_full(self):
     s = StringIO('\n'.join([
         '[default]',
         'aws_access_key_id = abcdefghijklmnopqrstuvwxyz',
         'aws_secret_access_key=ABCDEFGHIJKLMNOPQRSTUVWXYZ',
         'bucket = bucket-name',
         'region= ap-northeast-1',
         '[my.group.id]',
         'aws_access_key_id = zyxwvutsrqponmlkjihgfedcba',
         'aws_secret_access_key=ZYXWVUTSRQPONMLKJIHGFEDCBA',
         'bucket = bucket-name-123',
         'region= us-west-1',
     ]))
     self.assertEqual(Settings._read_aws_config(s, 'my.group.id'),
                      ('zyxwvutsrqponmlkjihgfedcba', 'ZYXWVUTSRQPONMLKJIHGFEDCBA', 'bucket-name-123', 'us-west-1'))
示例#7
0
 def test_read_aws_config_default_some(self):
     s = StringIO("""[default]\naws_access_key_id = abcdefghijklmnopqrstuvwxyz""")
     self.assertEqual(Settings._read_aws_config(s, 'mogproject'),
                      ('abcdefghijklmnopqrstuvwxyz', None, None, None))
示例#8
0
 def test_read_aws_config_empty(self):
     s = StringIO('')
     self.assertEqual(Settings._read_aws_config(s, ''), (None, None, None, None))
示例#9
0
 def test_read_aws_config_default_some(self):
     s = StringIO(
         """[default]\naws_access_key_id = abcdefghijklmnopqrstuvwxyz""")
     self.assertEqual(Settings._read_aws_config(s, 'mogproject'),
                      ('abcdefghijklmnopqrstuvwxyz', None, None, None))
示例#10
0
 def test_read_aws_config_empty(self):
     s = StringIO('')
     self.assertEqual(Settings._read_aws_config(s, ''),
                      (None, None, None, None))