forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuploader_test.go
31 lines (26 loc) · 1.12 KB
/
uploader_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package commands
import (
"testing"
"github.com/stretchr/testify/assert"
)
type LockingSupportTestCase struct {
Given string
ExpectedToMatch bool
}
func (l *LockingSupportTestCase) Assert(t *testing.T) {
assert.Equal(t, l.ExpectedToMatch, supportsLockingAPI(l.Given))
}
func TestSupportedLockingHosts(t *testing.T) {
for desc, c := range map[string]*LockingSupportTestCase{
"https with path prefix": {"https://github.com/ttaylorr/dotfiles.git/info/lfs", true},
"https with root": {"https://github.com/ttaylorr/dotfiles", true},
"http with path prefix": {"http://github.com/ttaylorr/dotfiles.git/info/lfs", false},
"http with root": {"http://github.com/ttaylorr/dotfiles", false},
"ssh with path prefix": {"ssh://github.com/ttaylorr/dotfiles.git/info/lfs", true},
"ssh with root": {"ssh://github.com/ttaylorr/dotfiles", true},
"ssh with user and path prefix": {"ssh://[email protected]/ttaylorr/dotfiles.git/info/lfs", true},
"ssh with user and root": {"ssh://[email protected]/ttaylorr/dotfiles", true},
} {
t.Run(desc, c.Assert)
}
}