MCPcopy Create free account
hub / github.com/bep/s3deploy / TestDetermineRootAndSubPath

Function TestDetermineRootAndSubPath

lib/cloudfront_test.go:70–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestDetermineRootAndSubPath(t *testing.T) {
71 c := qt.New(t)
72
73 var client *cloudFrontClient
74
75 check := func(bucketPath, originPath, expectWebContextRoot, expectSubPath string) {
76 t.Helper()
77 s1, s2 := client.determineRootAndSubPath(bucketPath, originPath)
78 c.Assert(s1, qt.Equals, expectWebContextRoot)
79 c.Assert(s2, qt.Equals, expectSubPath)
80 }
81
82 check("temp/forsale", "temp", "/forsale", "temp")
83 check("/temp/forsale/", "temp", "/forsale", "temp")
84 check("root", "root", "/", "root")
85 check("root", "/root", "/", "root")
86}
87
88func TestPathsToInvalidationBatch(t *testing.T) {
89 c := qt.New(t)

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected