def test_get_invitees(tinvite, einvite): """Test to check the function for the invite list""" obj = nc.Invite() assert obj.get_invitees(tinvite) == einvite
def test_radius_check(testdata, expected): """Test to check function for border test of radius""" obj = nc.Invite() assert obj.radius_check(testdata) == expected
def test_format_data(tdata, edata): """Test to check function for formatting of data""" obj = nc.Invite() assert obj.format_data(tdata) == edata
def test_distance_calculation(testdata, expected): """Test to check function for radial distance calculation""" obj = nc.Invite() lat, lon = testdata assert obj.dist_calculation(lat, lon) == expected
from invitation.compute import new_compute as nc if __name__ == '__main__': obj = nc.Invite() data = obj.get_data('data/data.json') fdata = obj.format_data(data) for uid, name, distance in obj.get_invitees(fdata): print "{}. {} is {} away from your location".format( uid, name, distance)