service_test.go 545 B

123456789101112131415161718
  1. // Copyright 2020-2021 InfluxData, Inc. All rights reserved.
  2. // Use of this source code is governed by MIT
  3. // license that can be found in the LICENSE file.
  4. package http
  5. import (
  6. "testing"
  7. "github.com/stretchr/testify/assert"
  8. )
  9. func TestService(t *testing.T) {
  10. srv := NewService("http://localhost:8086/aa/", "Token my-token", DefaultOptions())
  11. assert.Equal(t, "http://localhost:8086/aa/", srv.ServerURL())
  12. assert.Equal(t, "http://localhost:8086/aa/api/v2/", srv.ServerAPIURL())
  13. assert.Equal(t, "Token my-token", srv.Authorization())
  14. }