'æµè¯æ­£å regex_basic_mirrorlization'

def test__regex_basic_mirrorlization(self):

    from zmirror.external_pkgs.ColorfulPyPrint import errprint
    reg = self.zmirror.regex_basic_mirrorlization
    for domain in (list(self.C.external_domains) + [self.C.target_domain]):
        for slash in self.REGEX_POSSIBLE_SLASH:
            for suffix_slash in [True, False]:
                for explicit_scheme in ['http://', 'https://', '//', '']:
                    if (explicit_scheme == ''):
                        for quote in self.REGEX_POSSIBLE_QUOTE:
                            buff = (((quote + domain) + (slash if suffix_slash else '')) + quote)
                            try:
                                m = reg.fullmatch(buff)
                                assert (m.group('quote') == quote)
                                assert (m.group('domain') == domain)
                                assert (m.groupdict()['suffix_slash'] == (slash if suffix_slash else None))
                            except:
                                errprint('slash', slash, 'suffix_slash', suffix_slash, 'quote', quote, 'buff', buff)
                                raise
                    elif (':' in explicit_scheme):
                        for colon in self.REGEX_POSSIBLE_COLON:
                            _explicit_scheme = explicit_scheme.replace('/', slash).replace(':', colon)
                            buff = ((_explicit_scheme + domain) + (slash if suffix_slash else ''))
                            try:
                                m = reg.fullmatch(buff)
                                assert (m.group('scheme_slash') == slash)
                                assert (m.group('domain') == domain)
                                assert (m.group('colon') == colon)
                                assert (m.groupdict()['suffix_slash'] == (slash if suffix_slash else None))
                            except:
                                errprint('slash', slash, 'suffix_slash', suffix_slash, 'explicit_scheme', explicit_scheme, 'colon', colon, 'buff', buff)
                                raise
                    else:
                        _explicit_scheme = explicit_scheme.replace('/', slash)
                        buff = ((_explicit_scheme + domain) + (slash if suffix_slash else ''))
                        try:
                            m = reg.fullmatch(buff)
                            assert (m.group('scheme_slash') == slash)
                            assert (m.group('domain') == domain)
                            assert (m.groupdict()['suffix_slash'] == (slash if suffix_slash else None))
                        except:
                            errprint('slash', slash, 'suffix_slash', suffix_slash, 'explicit_scheme', explicit_scheme, 'buff', buff)
                            raise
