diff --git a/src/DarkSky.jl b/src/DarkSky.jl index 9fa2923..9329df1 100644 --- a/src/DarkSky.jl +++ b/src/DarkSky.jl @@ -28,7 +28,7 @@ end DarkSkyResponse(x::Dict) = DarkSkyResponse((get.(x, String.(fieldnames(DarkSkyResponse)), nothing))...) function Base.show(io::IO, x::DarkSkyResponse) - print(io, (x.latitude, x.longitude), "\n" * x.daily["summary"]) + print(io, (x.latitude, x.longitude)) end for fieldname in fieldnames(DarkSkyResponse) @@ -95,7 +95,7 @@ function forecast(latitude::Float64, longitude::Float64, time::DateTime; verbose exclude::Optional{Array{String}}=nothing, lang::String="en", units::String="us") @argcheck in(lang, SUPPORTED_LANGS) @argcheck in(units, SUPPORTED_UNITS) - url = "https://api.darksky.net/forecast/$(ENV["DARKSKY_API_KEY"])/$latitude,$longitude?lang=$lang&units=$units" + url = "https://api.darksky.net/forecast/$(ENV["DARKSKY_API_KEY"])/$latitude,$longitude,$time?lang=$lang&units=$units" if !(exclude === nothing) url = "$url&exclude=$(join(exclude, ","))" end diff --git a/test/runtests.jl b/test/runtests.jl index cc1a8d5..a06b21c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -15,6 +15,7 @@ if haskey(ENV, "DARKSKY_API_KEY") @test isa(daily(response), Dict{String, Any}) @test isa(alerts(response), Array{Any, 1}) | isa(alerts(response), Void) @test isa(flags(response), Dict{String, Any}) + @test isa(print(response), Void) @test isa(forecast(42.3601, -71.0589, DateTime(2018, 1, 1, 0, 0, 0), lang="es", units="si", exclude=["minutely"]), DarkSky.DarkSkyResponse) else warn("Dark Sky API key was not found in your system environment variables, skipping tests...")