def test_prepare_fails(self): def _makedirs(*args): ex = OSError() ex.errno = errno.EPERM raise ex with tmp_state_dir(): containers.prepare() with MonkeyPatchScope([(os, 'makedirs', _makedirs)]): self.assertRaises(OSError, containers.prepare)
def test_prepare_twice(self): with tmp_state_dir(): containers.prepare() self.assertNotRaises(containers.prepare)