TestUploadFile checks if uploading a file with the same content but different metadata works, and whether camliType is set to "file".
(t *testing.T)
| 50 | // TestUploadFile checks if uploading a file with the same content |
| 51 | // but different metadata works, and whether camliType is set to "file". |
| 52 | func 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. |
| 68 | func testUploadFile(t *testing.T, c *client.Client, f *fakeFile, withFileOpts bool) *schema.Blob { |
nothing calls this directly
no test coverage detected