def test_path_given_does_not_exist(self): path = tempfile.mkdtemp() os.rmdir(path) self.assertEqual( path, devappserver2._get_storage_path(path, 'example.com:myapp')) self.assertTrue(os.path.isdir(path))
def test_path_given_does_not_exist(self): path = tempfile.mkdtemp() os.rmdir(path) self.assertEqual( path, devappserver2._get_storage_path(path, 'myapp')) self.assertTrue(os.path.isdir(path))
def test_no_path_given_directory_does_not_exist(self): path = tempfile.mkdtemp() os.rmdir(path) devappserver2._generate_storage_paths("example.com_myapp").AndReturn([path]) self.mox.ReplayAll() self.assertEqual(path, devappserver2._get_storage_path(None, "dev~example.com:myapp")) self.mox.VerifyAll() self.assertTrue(os.path.isdir(path))
def test_no_path_given_directory_does_not_exist(self): path = tempfile.mkdtemp() os.rmdir(path) devappserver2._generate_storage_paths('example.com_myapp').AndReturn( [path]) self.mox.ReplayAll() self.assertEqual( path, devappserver2._get_storage_path(None, 'example.com:myapp')) self.mox.VerifyAll() self.assertTrue(os.path.isdir(path))
def test_no_path_given_directory_exists(self): path1 = tempfile.mkdtemp() os.chmod(path1, 0777) path2 = tempfile.mkdtemp() # Made with mode 0700. devappserver2._generate_storage_paths('myapp').AndReturn([path1, path2]) self.mox.ReplayAll() self.assertEqual( path2, devappserver2._get_storage_path(None, 'myapp')) self.mox.VerifyAll()
def test_no_path_given_directory_exists(self): path1 = tempfile.mkdtemp() os.chmod(path1, 0777) path2 = tempfile.mkdtemp() # Made with mode 0700. devappserver2._generate_storage_paths("example.com_myapp").AndReturn([path1, path2]) self.mox.ReplayAll() if sys.platform == "win32": expected_path = path1 else: expected_path = path2 self.assertEqual(expected_path, devappserver2._get_storage_path(None, "dev~example.com:myapp")) self.mox.VerifyAll()
def test_no_path_given_directory_exists(self): path1 = tempfile.mkdtemp() os.chmod(path1, 0o777) path2 = tempfile.mkdtemp() # Made with mode 0700. devappserver2._generate_storage_paths('example.com_myapp').AndReturn( [path1, path2]) self.mox.ReplayAll() if sys.platform == 'win32': expected_path = path1 else: expected_path = path2 self.assertEqual( expected_path, devappserver2._get_storage_path(None, 'dev~example.com:myapp')) self.mox.VerifyAll()
def test_path_given_exists(self): path = tempfile.mkdtemp() self.assertEqual( path, devappserver2._get_storage_path(path, 'myapp'))
def test_path_given_exists(self): path = tempfile.mkdtemp() self.assertEqual( path, devappserver2._get_storage_path(path, 'dev~example.com:myapp'))
def test_path_given_exists(self): path = tempfile.mkdtemp() self.assertEqual(path, devappserver2._get_storage_path(path, "dev~example.com:myapp"))