-
Notifications
You must be signed in to change notification settings - Fork 56
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
Multipart should use MapFS and MapFile from testing package in standard lib instead of OS #145
Comments
tjad
changed the title
Multipart should use MapFS and MapFile from testing package instead of OS
Multipart should use MapFS and MapFile from testing package in standard lib instead of OS
Jan 9, 2024
Would be happy to take a PR for this, sounds like a good idea. |
tjad
pushed a commit
to tjad/apitest
that referenced
this issue
Dec 8, 2024
@steinfletcher This issue popped up again for me :D Saw your message now. Let me know if anything should change. I added a struct OSFS for backward compatibility under the hood. The rest should be pretty straightforward. |
tjad
added a commit
to tjad/apitest
that referenced
this issue
Dec 8, 2024
tjad
added a commit
to tjad/apitest
that referenced
this issue
Dec 8, 2024
I reviewed again this morning noticed a bug in my test. Fixing. |
tjad
added a commit
to tjad/apitest
that referenced
this issue
Dec 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
This is an improvement request
Multipart should use MapFS and MapFile from testing package instead of OS. This would be more inline with testing as the file would be in memory and not be required to exist on disk
Describe the solution you'd like
Use https://pkg.go.dev/testing/fstest#MapFS
And https://pkg.go.dev/testing/fstest#MapFile
Describe alternatives you've considered
None - using the current implementation of Multipart in #118 #119 Is almost good enough, but this improvement would make it more complete - we don't want to use the file system during testing. The test data is binary, and storing it in git is not a particularly good way to go. Storing the bytes as integers in a file and writing to disk to be read is inefficient, messy and unnecessary, it is also not a good way to go as it would require cleanup etc etc etc.
The text was updated successfully, but these errors were encountered: