def test_dms_string_longitude(): for x in range(0, 5): target_decimal_value = random.uniform(0.0, 180.0) if(x % 2 == 1): target_decimal_value = target_decimal_value * -1 dms = geolocation.decimal_to_dms(target_decimal_value) dms_string = geolocation.dms_string(target_decimal_value, 'longitude') check_value = 'E' if target_decimal_value >= 0 else 'W' assert check_value in dms_string, '%s not in %s' % (check_value, dms_string) assert str(dms[0]) in dms_string, '%s not in %s' % (dms[0], dms_string)
def test_dms_string_longitude(): for x in range(0, 5): target_decimal_value = random.uniform(0.0, 180.0) if (x % 2 == 1): target_decimal_value = target_decimal_value * -1 dms = geolocation.decimal_to_dms(target_decimal_value) dms_string = geolocation.dms_string(target_decimal_value, 'longitude') check_value = 'E' if target_decimal_value >= 0 else 'W' assert check_value in dms_string, '%s not in %s' % (check_value, dms_string) assert str(dms[0]) in dms_string, '%s not in %s' % (dms[0], dms_string)