def test_bad_auth(self): """ Verify that bad auth shows correct error message """ # Arrange graphlab.aws.set_credentials('foo', 'bar') # Act & Assert try: ec2 = EC2._Ec2GraphLabServer('not-real-type', 'us-west-2', None, None, None, None, '', '') except Exception as e: self.assertTrue('EC2 response error. Please verify your AWS credentials' in e.message, e.message) else: self.fail('Expected an exception to be raised')
def test_bad_region(self): """ Verify that bad region shows correct error message. """ # Arrange graphlab.aws.set_credentials('foo', 'bar') # Act & Assert try: ec2 = EC2._Ec2GraphLabServer('not-real-type', 'not-real-region', None, None, None, None, '', '') except Exception as e: self.assertTrue('is not a valid region.' in e.message, e.message) else: self.fail('Expected an exception to be raised')
def test_no_auth_exception(self): """ Verify that no auth shows correct error message """ # Arrange instance_type = 'not-a-real-type' region = 'us-west-2' # Act & Assert try: ec2 = EC2._Ec2GraphLabServer(instance_type, region, None, None, None, None, '', '') except Exception as e: self.assertTrue("AWS configuration not found." in e.message, e.message) else: self.fail('Expected an exception to be raised')