func TestNewHistoryWithCustomHttpClient(t *testing.T) {
	hc := http.DefaultClient
	hc.Timeout = time.Duration(1) * time.Second
	h, err := NewHistorical("c", os.Getenv("OWM_API_KEY"), WithHttpClient(hc))
	if err != nil {
		t.Error(err)
	}
	if reflect.TypeOf(h).String() != "*openweathermap.HistoricalWeatherData" {
		t.Error("incorrect data type returned")
	}
	expected := time.Duration(1) * time.Second
	if h.client.Timeout != expected {
		t.Errorf("Expected Duration %v, but got %v", expected, h.client.Timeout)
	}
}
TestNewHistoryWithCustomHttpClient will verify that a new instance of HistoricalWeatherData
is created with custom http client
package openweathermap
import (
	"net/http"
	"os"
	"reflect"
	"testing"
	"time"
)
func TestNewHistory(t *testing.T) {
	t.Parallel()
	for d := range DataUnits {
		t.Logf("Data unit: %s", d)
		if ValidDataUnit(d) {
			c, err := NewHistorical(d, os.Getenv("OWM_API_KEY"))
			if err != nil {
				t.Error(err)
			}
			if reflect.TypeOf(c).String() != "*openweathermap.HistoricalWeatherData" {
				t.Error("incorrect data type returned")
			}
		} else {
			t.Errorf("unusable data unit - %s", d)
		}
	}
	_, err := NewHistorical("asdf", os.Getenv("OWM_API_KEY"))
	if err == nil {
		t.Error("created instance when it shouldn't have")
	}
}