Code review comment for lp:~raharper/curtin/trunk.fix-bcache-sysfs-write-failures-on-remove

Revision history for this message
Chad Smith (chad.smith) wrote :

I like the fact that you've added unit tests here, but the depth of mocking on this makes for unit tests that know too much about the internal implementation of the shutdown_bcache function. which means unittests will break more frequently if we change the operations performed by shutdown_bcache. Since the try/except handling is boilerplate for both cases, let's just pull it into a helper function which can be easily tested. Here's a patch for that and the simple unit tests addditions. I believe you can also drop your two unit tests as it feels like the mock depth will make it harder to maintain.

patch: http://paste.ubuntu.com/25733308/

review: Approve

« Back to merge proposal