def skip_if_missing_hypervisors(count=1, **params): message = "missing {return_value!r} hypervisor(s)" if params: message += " with {!s}".format( ', '.join("{!s}={!r}".format(k, v) for k, v in params.items())) return tobiko.skip_if(message, missing_hypervisors, count=count, **params)
def skip_unless_missing_networking_agents( binary: AgentBinaryType = None, **params) \ -> DecoratorType: if binary is not None: params['binary'] = binary message = "has {return_value!r} agent(s)" if params: message += " with {!s}".format(', '.join("{!s}={!r}".format(k, v) for k, v in params.items())) return tobiko.skip_if(message, count_networking_agents, **params)
def skip_if_missing_networking_extensions(*extensions): return tobiko.skip_if('missing networking extensions: {return_value!r}', missing_networking_extensions, *extensions)
def skip_if_router_is_distributed(cls, reason: str = None): fixture = tobiko.get_fixture(cls) if reason is None: reason = "Distributed router is not supported" return tobiko.skip_if(reason=reason, predicate=fixture.is_router_distributed)
def skip_if_missing_service(**params): return tobiko.skip_if('missing service: {!r}'.format(params), is_service_missing, **params)
def skip_if_prevent_create(reason='TOBIKO_PREVENT_CREATE is True'): return tobiko.skip_if(reason=reason, predicate=is_prevent_create)