amazonclouddrive, rcat: ensure rcat integration test passes even with AmazonCloudDrive (fixes: #1680)

This commit is contained in:
Stefan Breunig 2017-09-15 18:08:14 +02:00
parent 38cc211762
commit 9d3f11b493

View file

@ -735,17 +735,23 @@ func TestRcat(t *testing.T) {
checkSumBefore := fs.Config.CheckSum checkSumBefore := fs.Config.CheckSum
defer func() { fs.Config.CheckSum = checkSumBefore }() defer func() { fs.Config.CheckSum = checkSumBefore }()
check := func() { check := func(withChecksum bool) {
fs.Config.CheckSum = withChecksum
prefix := "no_checksum_"
if withChecksum {
prefix = "with_checksum_"
}
r := NewRun(t) r := NewRun(t)
defer r.Finalise() defer r.Finalise()
fstest.CheckListing(t, r.fremote, []fstest.Item{}) fstest.CheckListing(t, r.fremote, []fstest.Item{})
data1 := "this is some really nice test data" data1 := "this is some really nice test data"
path1 := "small_file_from_pipe" path1 := prefix + "small_file_from_pipe"
data2 := string(make([]byte, fs.Config.StreamingUploadCutoff+1)) data2 := string(make([]byte, fs.Config.StreamingUploadCutoff+1))
path2 := "big_file_from_pipe" path2 := prefix + "big_file_from_pipe"
in := ioutil.NopCloser(strings.NewReader(data1)) in := ioutil.NopCloser(strings.NewReader(data1))
err := fs.Rcat(r.fremote, path1, in, t1) err := fs.Rcat(r.fremote, path1, in, t1)
@ -760,11 +766,8 @@ func TestRcat(t *testing.T) {
fstest.CheckItems(t, r.fremote, file1, file2) fstest.CheckItems(t, r.fremote, file1, file2)
} }
fs.Config.CheckSum = true check(true)
check() check(false)
fs.Config.CheckSum = false
check()
} }
func TestRmdirs(t *testing.T) { func TestRmdirs(t *testing.T) {