示例#1
0
def test_ensure_dir(tc):
    dirname = os.path.join(tc.sandbox(), "sub")
    tc.assertFalse(os.path.exists(dirname))
    utils.ensure_dir(dirname)
    tc.assertTrue(os.path.isdir(dirname))
    utils.ensure_dir(dirname)
    tc.assertTrue(os.path.isdir(dirname))
    with tc.assertRaises(EnvironmentError) as ar:
        utils.ensure_dir(os.path.join(tc.sandbox(), "nonex", "sub"))
    tc.assertEqual(ar.exception.errno, errno.ENOENT)
示例#2
0
def test_ensure_dir(tc):
    dirname = os.path.join(tc.sandbox(), "sub")
    tc.assertFalse(os.path.exists(dirname))
    utils.ensure_dir(dirname)
    tc.assertTrue(os.path.isdir(dirname))
    utils.ensure_dir(dirname)
    tc.assertTrue(os.path.isdir(dirname))
    with tc.assertRaises(EnvironmentError) as ar:
        utils.ensure_dir(os.path.join(tc.sandbox(), "nonex", "sub"))
    tc.assertEqual(ar.exception.errno, errno.ENOENT)
示例#3
0
文件: game_jobs.py 项目: uduse/gomill
 def _ensure_dir(self, pathname):
     # For overriding in the testsuite
     utils.ensure_dir(pathname)
示例#4
0
 def _ensure_dir(self, pathname):
     # For overriding in the testsuite
     utils.ensure_dir(pathname)