def test_query_type_email_valid(self): emails = [ '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', ] for email in emails: assert get_query_type(email) == 'email'
def test_query_type_email_malformed(self): emails = [ 'johndoe @ gmail.com', 'john.doe@gmail', '[email protected]', 'john@' '@', '' ] for email in emails: assert get_query_type(email) == ''
def test_query_type_domain_malformed(self): domains = [ '//www.google.com/', 'https:/github.com/', 'htt://github.org', 'githubedu', '.io', 'github.' ] for domain in domains: assert get_query_type(domain) == ''
def test_query_type_domain_valid(self): domains = [ 'www.google.com', 'github.com', 'github.org', 'github.edu', 'github.io', 'github.me' ] for domain in domains: assert get_query_type(domain) == 'domain'