コード例 #1
0
 def test_validate_temp_creds_keys_success(self):
     # Check temporal keys
     self.assertTrue(validate_creds(
         aws_access_key_id='mine',
         aws_secret_access_key='mine',
         aws_session_token='mine'
     ))
コード例 #2
0
    def test_validate_creds_fails(self):
        # Check keys
        with self.assertRaises(argparse.ArgumentError):
            self.assertTrue(validate_creds(
                aws_session_token='mine',
                aws_secret_access_key='mine'
            ))

        with self.assertRaises(argparse.ArgumentError):
            self.assertTrue(validate_creds(
                aws_session_token='mine',
                aws_access_key_id='mine'
            ))

        with self.assertRaises(argparse.ArgumentError):
            self.assertTrue(validate_creds(
                aws_session_token='mine'
            ))

        # Check profile
        with self.assertRaises(argparse.ArgumentError):
            self.assertTrue(validate_creds(
                profile='mine',
                aws_secret_access_key='mine'
            ))

        with self.assertRaises(argparse.ArgumentError):
            self.assertTrue(validate_creds(
                aws_access_key_id='mine',
                profile='mine'
            ))

        # Check keys
        with self.assertRaises(argparse.ArgumentError):
            self.assertTrue(validate_creds(
                aws_access_key_id='mine',
            ))

        with self.assertRaises(argparse.ArgumentError):
            self.assertTrue(validate_creds(
                aws_secret_access_key='mine'
            ))
コード例 #3
0
 def test_validate_creds_keys_success(self):
     # Check keys
     self.assertTrue(validate_creds(
         aws_access_key_id='mine',
         aws_secret_access_key='mine'
     ))
コード例 #4
0
 def test_validate_creds_profile_success(self):
     # Check profile
     self.assertTrue(validate_creds(
         profile='mine'
     ))