Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
 def test_prepare_twice(self):
     with tmp_state_dir():
         containers.prepare()
         self.assertNotRaises(containers.prepare)
Beispiel #4
0
 def test_prepare_twice(self):
     with tmp_state_dir():
         containers.prepare()
         self.assertNotRaises(containers.prepare)