Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from collections.abc import Mapping
import pytest
from aenum import NamedConstant
from cfme.fixtures.templateloader import TEMPLATES
from cfme.utils.log import logger
# TODO restructure these to indirectly parametrize the name, and provide name constants here
# These are getting improperly imported and used as functions
class Templates(NamedConstant):
DPORTGROUP_TEMPLATE = "dportgroup_template"
DPORTGROUP_TEMPLATE_MODSCOPE = "dportgroup_template_modscope"
DUAL_DISK_TEMPLATE = "dual_disk_template"
DUAL_NETWORK_TEMPLATE = "dual_network_template"
RHEL69_TEMPLATE = "rhel69_template"
RHEL7_MINIMAL = "rhel7_minimal"
RHEL7_MINIMAL_MODSCOPE = "rhel7_minimal_modscope"
UBUNTU16_TEMPLATE = "ubuntu16_template"
WIN7_TEMPLATE = "win7_template"
WIN10_TEMPLATE = "win10_template"
WIN2016_TEMPLATE = "win2016_template"
WIN2012_TEMPLATE = "win2012_template"
@pytest.fixture(scope="function")
def template(template_location, provider):
u"""decorators for API permissions and the permissions themselves
:copyright: Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern.pkdebug import pkdc, pkdexc, pkdlog, pkdp
from pykern import pkinspect
import aenum
#: decorator sets this attribute with an APIPerm
ATTR = 'api_perm'
class APIPerm(aenum.Flag):
#: A user is required but there might not be a cookie yet
ALLOW_COOKIELESS_REQUIRE_USER = aenum.auto()
#: cookie.set_user can be called even if a cookie wasn't received
ALLOW_COOKIELESS_SET_USER = aenum.auto()
#: anybody can view this page, even without cookies
ALLOW_VISITOR = aenum.auto()
#: use basic auth authentication (only)
REQUIRE_AUTH_BASIC = aenum.auto()
#: a cookie has to have been returned, which might contain a user
REQUIRE_COOKIE_SENTINEL = aenum.auto()
#: a user will be created if necessary and auth may be necessary
REQUIRE_USER = aenum.auto()
def _init():
def _new(e):