コード例 #1
0
ファイル: utils_tests.py プロジェクト: cjlarose/gomill
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
ファイル: game_jobs.py プロジェクト: cjlarose/gomill
 def _ensure_dir(self, pathname):
     # For overriding in the testsuite
     utils.ensure_dir(pathname)