def test_encryption_is_enabled_failure(self): step = MockedStep() step.context.stash = [{ 'type': 'aws_db_instance', 'address': 'resource' }] with self.assertRaises(Failure): encryption_is_enabled(step)
def test_encryption_is_enabled_not_implemented(self): step = MockedStep() step.context.stash = [ { 'type': 'something' } ] with self.assertRaises(TerraformComplianceNotImplemented): encryption_is_enabled(step)
def test_encryption_is_enabled_success(self): step = MockedStep() step.context.stash = [{ 'type': 'aws_db_instance', 'values': { 'storage_encrypted': True } }] self.assertTrue(encryption_is_enabled(step))
def test_encryption_is_enabled_resource_list(self): step = MockedStep() step.context.stash.resource_list = None self.assertIsNone(encryption_is_enabled(step))
def test_encryption_is_enabled_resource_list(self): step = MockedStep() step.context.stash = MockedTerraformResourceList() self.assertIsNone(encryption_is_enabled(step))