

def test_present_when_trail_does_not_exist(self):
    '\n        Tests present on a trail that does not exist.\n        '
    self.conn.get_trail_status.side_effect = [not_found_error, status_ret]
    self.conn.create_trail.return_value = trail_ret
    self.conn.describe_trails.return_value = {
        'trailList': [trail_ret],
    }
    with patch.dict(funcs, {
        'boto_iam.get_account_id': MagicMock(return_value='1234'),
    }):
        result = salt_states['boto_cloudtrail.present']('trail present', Name=trail_ret['Name'], S3BucketName=trail_ret['S3BucketName'])
    result.assertTrue(result['result'])
    self.assertEqual(result['changes']['new']['trail']['Name'], trail_ret['Name'])

dataset/ETHPy150Open saltstack/salt/tests/unit/states/boto_cloudtrail_test.py BotoCloudTrailTestCase.test_present_when_trail_does_not_exist/VarMisuse@104/197 `self`->`result`