You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cant see how the linked unit test in this post references s3manageriface.UploadWithIterator (i get that things might have moved on but it seems to have removed it all together), it just seems to setup a http server as the session url and then just uses the normal Uploader type as a client but with an overiden server.url. I usually mock the API iface service (for example SSMAPI) and normally do the same when mocking the S3 upload for example to make sure that the unit test catches the call but in this case i cant due to the UploadWithIterator missing from the UploaderAPI.
If i was to do this without unit tests (:/) i would just use the Uploader type then use its UploadWithIterator. My normal route to writing unit tests would then be to convert the Uploader to UploaderAPI so i could mock the upload\batch function (guessing here as not been able to do it) and then just continue to unit test UploadWithIterator on that but i cant.
TL;DR;
Is there a minimal unit test i can reference for it with corresponding main code?
This discussion was converted from issue #5034 on December 13, 2023 17:54.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Describe the issue
Original issue: #1810
I cant see how the linked unit test in this post references s3manageriface.UploadWithIterator (i get that things might have moved on but it seems to have removed it all together), it just seems to setup a http server as the session url and then just uses the normal Uploader type as a client but with an overiden server.url. I usually mock the API iface service (for example SSMAPI) and normally do the same when mocking the S3 upload for example to make sure that the unit test catches the call but in this case i cant due to the UploadWithIterator missing from the UploaderAPI.
As the UploadWithIterator is a function on Uploader type (https://pkg.go.dev/github.com/aws/aws-sdk-go/service/s3/s3manager#Uploader.UploadWithIterator), how am i supposed to mock that function with an interface (https://pkg.go.dev/github.com/aws/[email protected]/service/s3/s3manager/s3manageriface#UploadWithIterator) and intercept the calls? This might be my basic knowledge of Go but this doesnt seem to function like all the other AWSSDK iface services i have used.
If i was to do this without unit tests (:/) i would just use the Uploader type then use its UploadWithIterator. My normal route to writing unit tests would then be to convert the Uploader to UploaderAPI so i could mock the upload\batch function (guessing here as not been able to do it) and then just continue to unit test UploadWithIterator on that but i cant.
TL;DR;
Is there a minimal unit test i can reference for it with corresponding main code?
Links
https://pkg.go.dev/github.com/aws/aws-sdk-go/service/s3/s3manager#Uploader.UploadWithIterator
Beta Was this translation helpful? Give feedback.
All reactions