-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ETags for Azure and Google Cloud [#176, #177] #183
Conversation
func TestSetProviderEtagAws(t *testing.T) { | ||
var awsV1Req s3.GetObjectInput | ||
assert.Nil(t, awsV1Req.IfMatch) | ||
asFunc := func(i interface{}) bool { | ||
v, ok := i.(**s3.GetObjectInput) | ||
if ok { | ||
*v = &awsV1Req | ||
} | ||
return true | ||
} | ||
setProviderEtag(asFunc, "123") | ||
assert.Equal(t, aws.String("123"), awsV1Req.IfMatch) | ||
} | ||
|
||
func TestSetProviderEtagAzure(t *testing.T) { | ||
var azOptions azblob.DownloadStreamOptions | ||
assert.Nil(t, azOptions.AccessConditions) | ||
asFunc := func(i interface{}) bool { | ||
v, ok := i.(**azblob.DownloadStreamOptions) | ||
if ok { | ||
*v = &azOptions | ||
} | ||
return ok | ||
} | ||
setProviderEtag(asFunc, "123") | ||
assert.Equal(t, azcore.ETag("123"), *azOptions.AccessConditions.ModifiedAccessConditions.IfMatch) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you have a similar test for google cloud?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to since conditions is not a public field of the gcp interface (is write-only through the If function)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok got it. This is probably as good as we can get on testing short of standing up a mock implementation of the provider's API 👍
@akhenakh @msbarry