Example #1
0
func TestKeyIsComplete(t *testing.T) {
	key := s3.Key{Key: "filename.txt"}
	if s3util.KeyIsComplete(key) {
		t.Errorf("KeyIsComplete should have returned false")
	}
	key.Size = 4800
	key.ETag = "aec157cfbc1a34d52"
	if !s3util.KeyIsComplete(key) {
		t.Errorf("KeyIsComplete should have returned true")
	}
}
Example #2
0
// Returns true of the S3 key is complete. In some cases, we only
// have the Key.Key and we have to fetch the rest from S3.
func (s3File *S3File) KeyIsComplete() bool {
	return s3util.KeyIsComplete(s3File.Key)
}