-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add S3 encode tests #340
Add S3 encode tests #340
Conversation
if now.After(s.expiryTime) { | ||
_ = s.writeObject() | ||
} |
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.
IIUC, this is the only place where expiryTime
is read. If it is removed from here, maybe the variable can be removed altogether.
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.
This is exactly for what the parameter is needed, to define the user's desired timeout period when to create a new object. So I don't think we can remove this.
expectedSubstring := "account1" | ||
require.True(t, strings.Contains(objectName0, expectedSubstring)) | ||
expectedSubstring = "year" | ||
require.True(t, strings.Contains(objectName0, expectedSubstring)) | ||
expectedSubstring = "month=" | ||
require.True(t, strings.Contains(objectName0, expectedSubstring)) | ||
expectedSubstring = "day=" | ||
require.True(t, strings.Contains(objectName0, expectedSubstring)) | ||
expectedSubstring = "hour=" | ||
require.True(t, strings.Contains(objectName0, expectedSubstring)) | ||
expectedSubstring = "stream-id=" | ||
require.True(t, strings.Contains(objectName0, expectedSubstring)) | ||
expectedSubstring = "00000000" | ||
require.True(t, strings.Contains(objectName0, expectedSubstring)) | ||
expectedSubstring = "00000001" | ||
require.True(t, strings.Contains(fakeWriter.objectNames[1], expectedSubstring)) | ||
expectedSubstring = "00000002" | ||
require.True(t, strings.Contains(fakeWriter.objectNames[2], expectedSubstring)) |
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.
Using require.Contains()
is preferred over require.True()
.
The advantage of require.Contains()
is that when the condition is not met, the error message is more verbose.
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.
updated accordingly
No description provided.