

def test_dir_missing(self):
    path = os.path.join(self.temp, 'adir/afile')
    self.assertRaises(errors.BadArgumentFormat, self.run_conv, converters.file(mode='w'), path)

    @modifiers.annotate(afile=converters.file(mode='w'))
    def func(afile):
        raise NotImplementedError
    (stdout, stderr) = self.crun(func, ['test', path])
    self.assertFalse(stdout.getvalue())
    self.assertTrue(stderr.getvalue().startswith('test: Bad value for afile: Directory does not exist: '))

dataset/ETHPy150Open epsy/clize/clize/tests/test_converters.py FileConverterTests.test_dir_missing/original