2019-12-20 11:30:58 +01:00
|
|
|
package maps
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/maps/osm"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2019-12-20 12:04:26 +01:00
|
|
|
func TestLocation_Query(t *testing.T) {
|
|
|
|
t.Run("BerlinFernsehturm", func(t *testing.T) {
|
|
|
|
lat := 52.5208
|
|
|
|
lng := 13.40953
|
|
|
|
|
2019-12-20 20:23:16 +01:00
|
|
|
l := NewLocation(lat, lng)
|
2019-12-20 12:04:26 +01:00
|
|
|
|
2019-12-20 20:23:16 +01:00
|
|
|
if err := l.Query(); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Fernsehturm Berlin", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Berlin, Germany", l.LocLabel)
|
2019-12-20 12:04:26 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-12-20 20:23:16 +01:00
|
|
|
func TestLocation_Assign(t *testing.T) {
|
2019-12-20 11:30:58 +01:00
|
|
|
t.Run("BerlinFernsehturm", func(t *testing.T) {
|
|
|
|
lat := 52.5208
|
|
|
|
lng := 13.40953
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.Equal(t, 189675302, o.PlaceID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Fernsehturm Berlin", o.LocName)
|
2019-12-20 11:30:58 +01:00
|
|
|
assert.Equal(t, "10178", o.Address.Postcode)
|
|
|
|
assert.Equal(t, "Berlin", o.Address.State)
|
|
|
|
assert.Equal(t, "de", o.Address.CountryCode)
|
|
|
|
assert.Equal(t, "Germany", o.Address.Country)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
2019-12-20 12:20:35 +01:00
|
|
|
if err := l.Assign(o); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-12-20 11:30:58 +01:00
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Fernsehturm Berlin", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Berlin, Germany", l.LocLabel)
|
2019-12-20 11:30:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("SantaMonica", func(t *testing.T) {
|
|
|
|
lat := 34.00909444444444
|
|
|
|
lng := -118.49700833333334
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.False(t, o.Cached)
|
|
|
|
assert.Equal(t, 79854991, o.PlaceID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Santa Monica Pier", o.LocName)
|
2019-12-20 11:30:58 +01:00
|
|
|
assert.Equal(t, "90401", o.Address.Postcode)
|
|
|
|
assert.Equal(t, "California", o.Address.State)
|
|
|
|
assert.Equal(t, "us", o.Address.CountryCode)
|
|
|
|
assert.Equal(t, "United States of America", o.Address.Country)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
2019-12-20 12:20:35 +01:00
|
|
|
if err := l.Assign(o); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-12-20 11:30:58 +01:00
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Santa Monica Pier", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Santa Monica, California, USA", l.LocLabel)
|
2019-12-20 11:30:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("AirportZurich", func(t *testing.T) {
|
|
|
|
lat := 47.45401666666667
|
|
|
|
lng := 8.557494444444446
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.False(t, o.Cached)
|
|
|
|
|
|
|
|
assert.Equal(t, 115198412, o.PlaceID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Dock A", o.LocName)
|
2019-12-20 11:30:58 +01:00
|
|
|
assert.Equal(t, "8302", o.Address.Postcode)
|
|
|
|
assert.Equal(t, "Zurich", o.Address.State)
|
|
|
|
assert.Equal(t, "ch", o.Address.CountryCode)
|
|
|
|
assert.Equal(t, "Switzerland", o.Address.Country)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
2019-12-20 12:20:35 +01:00
|
|
|
if err := l.Assign(o); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-12-20 11:30:58 +01:00
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Airport", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Kloten, Zurich, Switzerland", l.LocLabel)
|
2019-12-20 11:30:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("AirportTegel", func(t *testing.T) {
|
|
|
|
lat := 52.559864397033024
|
|
|
|
lng := 13.28895092010498
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.False(t, o.Cached)
|
|
|
|
|
|
|
|
assert.Equal(t, 25410613, o.PlaceID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "TGL", o.LocName)
|
2019-12-20 11:30:58 +01:00
|
|
|
assert.Equal(t, "13405", o.Address.Postcode)
|
|
|
|
assert.Equal(t, "Berlin", o.Address.State)
|
|
|
|
assert.Equal(t, "de", o.Address.CountryCode)
|
|
|
|
assert.Equal(t, "Germany", o.Address.Country)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
2019-12-20 12:20:35 +01:00
|
|
|
if err := l.Assign(o); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-12-20 11:30:58 +01:00
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Airport", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Berlin, Germany", l.LocLabel)
|
2019-12-20 11:30:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("PinkBeach", func(t *testing.T) {
|
|
|
|
lat := 35.26967222222222
|
|
|
|
lng := 23.53711666666667
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.False(t, o.Cached)
|
|
|
|
|
|
|
|
assert.Equal(t, 119616937, o.PlaceID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Pink Beach", o.LocName)
|
2019-12-20 11:30:58 +01:00
|
|
|
assert.Equal(t, "", o.Address.Postcode)
|
|
|
|
assert.Equal(t, "Crete", o.Address.State)
|
|
|
|
assert.Equal(t, "gr", o.Address.CountryCode)
|
|
|
|
assert.Equal(t, "Greece", o.Address.Country)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
2019-12-20 12:20:35 +01:00
|
|
|
if err := l.Assign(o); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-12-20 11:30:58 +01:00
|
|
|
|
2019-12-27 23:58:51 +01:00
|
|
|
assert.Equal(t, uint64(0x149ce78540000000), l.ID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Pink Beach", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Chrisoskalitissa, Crete, Greece", l.LocLabel)
|
2019-12-20 11:30:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("NewJersey", func(t *testing.T) {
|
|
|
|
lat := 40.74290
|
|
|
|
lng := -74.04862
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.False(t, o.Cached)
|
|
|
|
|
|
|
|
assert.Equal(t, 164551421, o.PlaceID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "", o.LocName)
|
2019-12-20 11:30:58 +01:00
|
|
|
assert.Equal(t, "07307", o.Address.Postcode)
|
|
|
|
assert.Equal(t, "New Jersey", o.Address.State)
|
|
|
|
assert.Equal(t, "us", o.Address.CountryCode)
|
|
|
|
assert.Equal(t, "United States", o.Address.Country)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
2019-12-20 12:20:35 +01:00
|
|
|
if err := l.Assign(o); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-12-20 11:30:58 +01:00
|
|
|
|
2019-12-27 23:58:51 +01:00
|
|
|
assert.Equal(t, uint64(0x9c25741c0000000), l.ID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Jersey City, New Jersey, USA", l.LocLabel)
|
2019-12-20 11:30:58 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
t.Run("SouthAfrica", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.False(t, o.Cached)
|
|
|
|
|
|
|
|
assert.Equal(t, 98820569, o.PlaceID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "R411", o.LocName)
|
2019-12-20 11:30:58 +01:00
|
|
|
assert.Equal(t, "", o.Address.Postcode)
|
|
|
|
assert.Equal(t, "Eastern Cape", o.Address.State)
|
|
|
|
assert.Equal(t, "za", o.Address.CountryCode)
|
|
|
|
assert.Equal(t, "South Africa", o.Address.Country)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
2019-12-20 12:20:35 +01:00
|
|
|
if err := l.Assign(o); err != nil {
|
2019-12-20 12:04:26 +01:00
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-12-20 11:30:58 +01:00
|
|
|
|
2019-12-27 23:58:51 +01:00
|
|
|
assert.Equal(t, uint64(0x1e5e4205c0000000), l.ID)
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "R411", l.LocName)
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Eastern Cape, South Africa", l.LocLabel)
|
2019-12-20 11:30:58 +01:00
|
|
|
})
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
t.Run("Unknown", func(t *testing.T) {
|
|
|
|
lat := -21.976301666666668
|
|
|
|
lng := 49.148046666666666
|
|
|
|
|
|
|
|
o, err := osm.FindLocation(lat, lng)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.False(t, o.Cached)
|
|
|
|
|
|
|
|
var l Location
|
|
|
|
|
|
|
|
assert.Error(t, l.Assign(o))
|
|
|
|
assert.Equal(t, "unknown", l.LocCategory)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_Unknown(t *testing.T) {
|
|
|
|
t.Run("true", func(t *testing.T) {
|
|
|
|
lat := 0.0
|
|
|
|
lng := 0.0
|
|
|
|
|
|
|
|
l := NewLocation(lat, lng)
|
|
|
|
|
|
|
|
assert.Equal(t, true, l.Unknown())
|
|
|
|
})
|
|
|
|
t.Run("false", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
|
|
|
l := NewLocation(lat, lng)
|
|
|
|
|
|
|
|
assert.Equal(t, false, l.Unknown())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
func TestLocation_place(t *testing.T) {
|
2019-12-22 21:39:53 +01:00
|
|
|
t.Run("unknown", func(t *testing.T) {
|
|
|
|
lat := 0.0
|
|
|
|
lng := 0.0
|
|
|
|
|
|
|
|
l := NewLocation(lat, lng)
|
|
|
|
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Unknown", l.label())
|
2019-12-22 21:39:53 +01:00
|
|
|
})
|
|
|
|
t.Run("Nürnberg, Bayern, Germany", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "Nürnberg, Bayern, Germany", l.label())
|
2019-12-22 21:39:53 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_Latitude(t *testing.T) {
|
|
|
|
t.Run("-31.976301666666668", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, -31.976301666666668, l.Latitude())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_Longitude(t *testing.T) {
|
|
|
|
t.Run("29.148046666666666", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, 29.148046666666666, l.Longitude())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
func TestLocation_Name(t *testing.T) {
|
|
|
|
t.Run("Christkindlesmarkt", func(t *testing.T) {
|
2019-12-22 21:39:53 +01:00
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern", LocName: "Christkindlesmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Christkindlesmarkt", l.Name())
|
2019-12-22 21:39:53 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_City(t *testing.T) {
|
|
|
|
t.Run("Nürnberg", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern", LocName: "Christkindlesmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, "Nürnberg", l.City())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_Suburb(t *testing.T) {
|
2019-12-27 05:18:52 +01:00
|
|
|
t.Run("Hauptmarkt", func(t *testing.T) {
|
2019-12-22 21:39:53 +01:00
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern", LocName: "Christkindlesmarkt", LocSuburb: "Hauptmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
assert.Equal(t, "Hauptmarkt", l.Suburb())
|
2019-12-22 21:39:53 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_State(t *testing.T) {
|
|
|
|
t.Run("Bayern", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern", LocName: "Christkindlesmarkt", LocSuburb: "Hauptmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, "Bayern", l.State())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_Category(t *testing.T) {
|
|
|
|
t.Run("test", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocCategory: "test", LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern", LocName: "Christkindlesmarkt", LocSuburb: "Hauptmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, "test", l.Category())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_Source(t *testing.T) {
|
|
|
|
t.Run("source", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
l := &Location{LocCategory: "test", LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocState: "Bayern", LocName: "Christkindlesmarkt", LocSuburb: "Hauptmarkt", LocSource: "source"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, "source", l.Source())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-12-27 05:18:52 +01:00
|
|
|
func TestLocation_Place(t *testing.T) {
|
2019-12-28 20:24:20 +01:00
|
|
|
t.Run("test-label", func(t *testing.T) {
|
2019-12-22 21:39:53 +01:00
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-28 20:24:20 +01:00
|
|
|
l := &Location{LocCategory: "test", LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocLabel: "test-label", LocState: "Bayern", LocName: "Christkindlesmarkt", LocSuburb: "Hauptmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
2019-12-28 20:24:20 +01:00
|
|
|
assert.Equal(t, "test-label", l.Label())
|
2019-12-22 21:39:53 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_CountryCode(t *testing.T) {
|
|
|
|
t.Run("de", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-28 20:24:20 +01:00
|
|
|
l := &Location{LocCategory: "test", LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocLabel: "test-label", LocState: "Bayern", LocName: "Christkindlesmarkt", LocSuburb: "Hauptmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, "de", l.CountryCode())
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLocation_CountryName(t *testing.T) {
|
|
|
|
t.Run("Germany", func(t *testing.T) {
|
|
|
|
lat := -31.976301666666668
|
|
|
|
lng := 29.148046666666666
|
|
|
|
|
2019-12-28 20:24:20 +01:00
|
|
|
l := &Location{LocCategory: "test", LocLat: lat, LocLng: lng, LocCountry: "de", LocCity: "Nürnberg", LocLabel: "test-label", LocState: "Bayern", LocName: "Christkindlesmarkt", LocSuburb: "Hauptmarkt"}
|
2019-12-22 21:39:53 +01:00
|
|
|
|
|
|
|
assert.Equal(t, "Germany", l.CountryName())
|
|
|
|
})
|
2019-12-20 11:30:58 +01:00
|
|
|
}
|