(uri, validated_components)
Assert that all components are valid in the URI.
Assert that all components are valid in the URI.
Assert that all components are valid in the URI .
def ensure_components_are_valid(uri, validated_components):
    """Assert that all components are valid in the URI."""
    invalid_components = set([])
    for component in validated_components:
        if component in _SUBAUTHORITY_VALIDATORS:
            if not subauthority_component_is_valid(uri, component):
                invalid_components.add(component)
            # Python's peephole optimizer means that while this continue *is*
            # actually executed, coverage.py cannot detect that. See also,
            # https://bitbucket.org/ned/coveragepy/issues/198/continue-marked-as-not-covered
            continue  # nocov: Python 2.7, 3.3, 3.4

        validator = _COMPONENT_VALIDATORS[component]
        if not validator(getattr(uri, component)):
            invalid_components.add(component)

    if invalid_components:
        raise exceptions.InvalidComponentsError(uri, *invalid_components)
def ensure_components_are_valid ( uri , validated_components ) : invalid_components = set ( [ ] ) for component in validated_components : if component in _SUBAUTHORITY_VALIDATORS : if not subauthority_component_is_valid ( uri , component ) : invalid_components . add ( component ) # Python's peephole optimizer means that while this continue *is* # actually executed, coverage.py cannot detect that. See also, # https://bitbucket.org/ned/coveragepy/issues/198/continue-marked-as-not-covered continue # nocov: Python 2.7, 3.3, 3.4 validator = _COMPONENT_VALIDATORS [ component ] if not validator ( getattr ( uri , component ) ) : invalid_components . add ( component ) if invalid_components : raise exceptions . InvalidComponentsError ( uri , * invalid_components )