def test_whois(): api_call = api.whois('google.com') with api_call as whois: assert 'registrant' in whois assert 'name_servers' in whois assert 'whois' in whois assert 'record_source' in whois assert '*****@*****.**' in api_call.emails()
def test_dict_like_behaviour(): with api.whois('google.com') as whois_google: assert len(whois_google.items()) assert len(whois_google.keys()) assert len(whois_google.values()) assert whois_google.has_key('registrant') assert 'registrant' in whois_google whois_google.update({'registrant': 'override'}) assert whois_google['registrant'] == 'override' del whois_google['registrant'] assert not 'registrant' in whois_google whois_google['registrant'] = 'me' assert whois_google['registrant'] == 'me' assert isinstance(whois_google.pop('whois', {}), dict)