本文整理汇总了Python中plone.resourceeditor.browser.FileManager.addFolder方法的典型用法代码示例。如果您正苦于以下问题:Python FileManager.addFolder方法的具体用法?Python FileManager.addFolder怎么用?Python FileManager.addFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.resourceeditor.browser.FileManager
的用法示例。
在下文中一共展示了FileManager.addFolder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_addfolder
# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import addFolder [as 别名]
def test_addfolder(self):
from plone.resourceeditor.browser import FileManager
r = self._make_directory()
view = FileManager(r, self.layer['request'])
info = view.addFolder('/', 'alpha')
self.assertEqual(info['code'], 0)
self.assertEqual(info['error'], '')
self.assertEqual(info['parent'], '/')
self.assertEqual(info['name'], 'alpha')
info = view.addFolder('/alpha', 'beta')
self.assertEqual(info['code'], 0)
self.assertEqual(info['error'], '')
self.assertEqual(info['parent'], '/alpha')
self.assertEqual(info['name'], 'beta')
示例2: test_addfolder
# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import addFolder [as 别名]
def test_addfolder(self):
from plone.resourceeditor.browser import FileManager
r = self._make_directory()
view = FileManager(r, self.layer["request"])
info = view.addFolder("/", "alpha")
self.assertEqual(info["code"], 0)
self.assertEqual(info["error"], "")
self.assertEqual(info["parent"], "/")
self.assertEqual(info["name"], "alpha")
info = view.addFolder("/alpha", "beta")
self.assertEqual(info["code"], 0)
self.assertEqual(info["error"], "")
self.assertEqual(info["parent"], "/alpha")
self.assertEqual(info["name"], "beta")
示例3: test_addfolder_invalid_name
# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import addFolder [as 别名]
def test_addfolder_invalid_name(self):
from plone.resourceeditor.browser import FileManager
r = self._make_directory()
r.makeDirectory('alpha')
view = FileManager(r, self.layer['request'])
for char in '\\/:*?"<>':
info = view.addFolder('/', 'foo' + char)
self.assertEqual(info['code'], 1)
self.assertNotEqual(info['error'], '')
self.assertEqual(info['parent'], '/')
self.assertEqual(info['name'], 'foo' + char)
示例4: test_addfolder_invalid_name
# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import addFolder [as 别名]
def test_addfolder_invalid_name(self):
from plone.resourceeditor.browser import FileManager
r = self._make_directory()
r.makeDirectory("alpha")
view = FileManager(r, self.layer["request"])
for char in '\\/:*?"<>':
info = view.addFolder("/", "foo" + char)
self.assertEqual(info["code"], 1)
self.assertNotEqual(info["error"], "")
self.assertEqual(info["parent"], "/")
self.assertEqual(info["name"], "foo" + char)