gitea源码

12345678910111213141516171819202122
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package lfs
  4. import (
  5. "net/url"
  6. "testing"
  7. "github.com/stretchr/testify/assert"
  8. )
  9. func TestNewClient(t *testing.T) {
  10. u, _ := url.Parse("file:///test")
  11. c := NewClient(u, nil)
  12. assert.IsType(t, &FilesystemClient{}, c)
  13. u, _ = url.Parse("https://test.com/lfs")
  14. c = NewClient(u, nil)
  15. assert.IsType(t, &HTTPClient{}, c)
  16. }