Open blackfist opened 9 years ago
Once #59 is merged into master, you can merge that into here (or just do that from your own branch) so we can get happy :white_check_mark:
you mean we need to add a test to test_domain_to_geo
where we pass something like heroku.com so that it tests the conditional? Or do we need to write the test so that it checks if a warning is raised? Because that second one seems more difficult.
Oops, missed your question here. The first one - it'll test the conditional and raise the warning and that'll be good.
This shows as good to go, is it?
This came up for discussion in our python code review club meeting earlier this week. The
domain_to_geo
function passes the domain directly to pygeoip which returns a location. However if the domain being searched uses round-robin DNS for some reason then the domain may resolve to multiple IP addresses which could be in several places.This PR adds a function called
domain_to_mgeo
which will get all the ip addresses that the domain resolves to and then get location info for each of them, returning a list of dictionaries. In order to honor the promises made by previous functions, the existingdomain_to_geo
function continues to work the way it did before but it does raise a warning if a domain resolves to multiple ip addresses.