MCPcopy
hub / github.com/perkeep/perkeep / TestUploadFile

Function TestUploadFile

pkg/test/integration/upload_test.go:52–65  ·  view source on GitHub ↗

TestUploadFile checks if uploading a file with the same content but different metadata works, and whether camliType is set to "file".

(t *testing.T)

Source from the content-addressed store, hash-verified

50// TestUploadFile checks if uploading a file with the same content
51// but different metadata works, and whether camliType is set to "file".
52func TestUploadFile(t *testing.T) {
53 w := test.GetWorld(t)
54 c := client.NewOrFail(client.OptionServer(w.ServerBaseURL()))
55 f := newFakeFile("foo.txt", "bar", time.Date(2011, 1, 28, 2, 3, 4, 0, time.Local))
56
57 testUploadFile(t, c, f, false)
58 testUploadFile(t, c, f, true)
59
60 f.modTime = f.modTime.Add(time.Hour)
61 testUploadFile(t, c, f, true)
62
63 f.name = "baz.txt"
64 testUploadFile(t, c, f, true)
65}
66
67// testUploadFile uploads a file and checks if it can be retrieved.
68func testUploadFile(t *testing.T, c *client.Client, f *fakeFile, withFileOpts bool) *schema.Blob {

Callers

nothing calls this directly

Calls 7

GetWorldFunction · 0.92
NewOrFailFunction · 0.92
OptionServerFunction · 0.92
newFakeFileFunction · 0.85
testUploadFileFunction · 0.85
ServerBaseURLMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected