Skip to content

main: Mock file system and add getFile tests

This uses afero to proxy all file system accesses and then injects an in-memory file system in order to test the getFile function.

I'm not very familiar with Go so there might be a better way to do this. Afero turned up in my Google search for "mock file system in go". It is (mostly) compatible with the system package interfaces which made it relatively easy to replace the various calls.

This could also be used to write unit tests against other parts of the program but I limited it to getFile for now as POC.

Merge request reports