Ejemplo n.º 1
0
def test_get_invitees(tinvite, einvite):
    """Test to check the function for the invite list"""
    obj = nc.Invite()
    assert obj.get_invitees(tinvite) == einvite
Ejemplo n.º 2
0
def test_radius_check(testdata, expected):
    """Test to check function for border test of radius"""
    obj = nc.Invite()
    assert obj.radius_check(testdata) == expected
Ejemplo n.º 3
0
def test_format_data(tdata, edata):
    """Test to check function for formatting of data"""
    obj = nc.Invite()
    assert obj.format_data(tdata) == edata
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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)