Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(24)  |  Call(24)  |  Derive(0)  |  Import(0)

src/f/l/flanker-0.4.14/tests/addresslib/validator_test.py   flanker(Download)
        mock_method.side_effect = mock_exchanger_lookup
 
        parse, unpar = address.validate_list(', '.join(valid_tld_list), as_tuple=True)
        assert_equal(parse, valid_tld_list)
        assert_equal(unpar, [])
 
        parse, unpar = address.validate_list(', '.join(valid_domain_list), as_tuple=True)
        assert_equal(unpar, [])
 
        parse, unpar = address.validate_list(', '.join(valid_subdomain_list), as_tuple=True)
        assert_equal(parse, valid_subdomain_list)
        assert_equal(unpar, [])
 
        # all invalid
        parse, unpar = address.validate_list(', '.join(invalid_mx_list), as_tuple=True)
        assert_equal(unpar, invalid_mx_list)
 
        parse, unpar = address.validate_list(', '.join(invalid_tld_list), as_tuple=True)
        assert_equal(parse, [])
        assert_equal(unpar, invalid_tld_list)

src/f/l/flanker-HEAD/tests/addresslib/validator_test.py   flanker(Download)
        mock_method.side_effect = mock_exchanger_lookup
 
        parse, unpar = address.validate_list(', '.join(valid_tld_list), as_tuple=True)
        assert_equal(parse, valid_tld_list)
        assert_equal(unpar, [])
 
        parse, unpar = address.validate_list(', '.join(valid_domain_list), as_tuple=True)
        assert_equal(unpar, [])
 
        parse, unpar = address.validate_list(', '.join(valid_subdomain_list), as_tuple=True)
        assert_equal(parse, valid_subdomain_list)
        assert_equal(unpar, [])
 
        # all invalid
        parse, unpar = address.validate_list(', '.join(invalid_mx_list), as_tuple=True)
        assert_equal(unpar, invalid_mx_list)
 
        parse, unpar = address.validate_list(', '.join(invalid_tld_list), as_tuple=True)
        assert_equal(parse, [])
        assert_equal(unpar, invalid_tld_list)

src/f/l/flanker-0.4.14/tests/addresslib/metrics_test.py   flanker(Download)
        mock_method.side_effect = mock_exchanger_lookup
 
        assert_equal(len(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=True)), 2)
        p, m = address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=True)
        assert_equal('parsing' in m, True)
        assert_equal('mx_lookup' in m, True)
        assert_equal('dns_lookup' in m, True)
        assert_equal('mx_conn' in m, True)
        assert_equal('custom_grammar' in m, True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=False), address.AddressList), True)
        assert_equal('custom_grammar' in m, True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=False), address.AddressList), True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org'), address.AddressList), True)
 

src/f/l/flanker-HEAD/tests/addresslib/metrics_test.py   flanker(Download)
        mock_method.side_effect = mock_exchanger_lookup
 
        assert_equal(len(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=True)), 2)
        p, m = address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=True)
        assert_equal('parsing' in m, True)
        assert_equal('mx_lookup' in m, True)
        assert_equal('dns_lookup' in m, True)
        assert_equal('mx_conn' in m, True)
        assert_equal('custom_grammar' in m, True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=False), address.AddressList), True)
        assert_equal('custom_grammar' in m, True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=False), address.AddressList), True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org'), address.AddressList), True)