INNER CODE UNIT · Go

Test_isCustomer_No_EmptyFile

alexellis/derek · auth/isCustomer_test.go:67

func Test_isCustomer_No_EmptyFile(t *testing.T) {
	os.Setenv("validate_customers", "true")

	handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		io.WriteString(w, ``)
	})

	server := httptest.NewServer(handler)
	defer server.Close()
	os.Setenv("customers_url", server.URL+"/CUSTOMERS")

	owner := "alex"
	isCustomer, err := IsCustomer(owner, server.Client())
	if err != nil {
		t.Errorf("want no error, but got one: %s", err)
		t.Fail()
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…