def test_8_8_8_8_ip_specific(self, requests_post): def mock_requests_post(*args,**kwargs): class __mock(): f = open('%s/tests/mocks/8.8.8.8_result.html' % basedir, 'r') text = f.read() return __mock requests_post.side_effect = mock_requests_post s = SenderBase() result = s.lookup_ip('8.8.8.8') assert result is not None assert result['ip'] == '8.8.8.8' assert result['network_owner'] == 'Google' assert result['web_reputation'] == 'Neutral' assert result['black_listed'] == False assert result['host_name'] == 'google-public-dns-a.google.com' assert result['blacklists'][0]['bl.spamcop.net'] == 'Not Listed' assert result['blacklists'][2]['pbl.spamhaus.org'] == 'Not Listed' assert result['web_category'] == 'Search Engines and Portals' assert result['email_reputation'] == 'Good' assert result['fwd_rev_dns_match'] == 'Yes'