stratis-storage/stratis-cli

Test that our device paths are always absolute using mock objects

Closed this issue · 2 comments

We can do this exclusively in the CLI.

We'ld have to synthesize a valid relative path from the current working directory and the known absolute path. We can do that, with os.path.relpath.

Why do it in the blackbox instead of the whitebox tests? Because the sim engine doesn't care if paths are real or not. But we could do a fake test which invoked the methods, and used a mock object to determine that the arguments were correct.

Right now this all seems like too much trouble.

Actually, monkey patching and using mock objects really doesn't seem all that bad. And we may someday have to use mock objects for something harder to check, so this might be a good start.