当前位置: 首页>>代码示例>>Python>>正文


Python FileManager.move方法代码示例

本文整理汇总了Python中plone.resourceeditor.browser.FileManager.move方法的典型用法代码示例。如果您正苦于以下问题:Python FileManager.move方法的具体用法?Python FileManager.move怎么用?Python FileManager.move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plone.resourceeditor.browser.FileManager的用法示例。


在下文中一共展示了FileManager.move方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_move_invalid_parent

# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import move [as 别名]
    def test_move_invalid_parent(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()
        r.writeFile('test.txt', b'foo')

        view = FileManager(r, self.layer['request'])

        info = view.move('/test.txt', '/alpha')

        self.assertEqual(info['code'], 1)
        self.assertNotEqual(info['error'], '')
        self.assertEqual(info['newPath'], '/alpha/test.txt')

        self.assertTrue('test.txt' in r)
开发者ID:plone,项目名称:plone.resourceeditor,代码行数:16,代码来源:test_file_manager.py

示例2: test_move_invalid_parent

# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import move [as 别名]
    def test_move_invalid_parent(self):
        from plone.resourceeditor.browser import FileManager

        r = self._make_directory()
        r.writeFile("test.txt", "foo")

        view = FileManager(r, self.layer["request"])

        info = view.move("/test.txt", "/alpha")

        self.assertEqual(info["code"], 1)
        self.assertNotEqual(info["error"], "")
        self.assertEqual(info["newPath"], "/alpha/test.txt")

        self.assertTrue("test.txt" in r)
开发者ID:plone,项目名称:plone.resourceeditor,代码行数:17,代码来源:tests.py

示例3: test_move

# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import move [as 别名]
    def test_move(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()
        r.makeDirectory('alpha')
        r.writeFile('test.txt', b'foo')

        view = FileManager(r, self.layer['request'])

        info = view.move('/test.txt', '/alpha')

        self.assertEqual(info['code'], 0)
        self.assertEqual(info['error'], '')
        self.assertEqual(info['newPath'], '/alpha/test.txt')

        self.assertFalse('test.txt' in r)
        self.assertEqual(b'foo', r['alpha'].readFile('test.txt'))
开发者ID:plone,项目名称:plone.resourceeditor,代码行数:18,代码来源:test_file_manager.py

示例4: test_move

# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import move [as 别名]
    def test_move(self):
        from plone.resourceeditor.browser import FileManager

        r = self._make_directory()
        r.makeDirectory("alpha")
        r.writeFile("test.txt", "foo")

        view = FileManager(r, self.layer["request"])

        info = view.move("/test.txt", "/alpha")

        self.assertEqual(info["code"], 0)
        self.assertEqual(info["error"], "")
        self.assertEqual(info["newPath"], "/alpha/test.txt")

        self.assertFalse("test.txt" in r)
        self.assertEqual("foo", r["alpha"].readFile("test.txt"))
开发者ID:plone,项目名称:plone.resourceeditor,代码行数:19,代码来源:tests.py

示例5: test_move_exists

# 需要导入模块: from plone.resourceeditor.browser import FileManager [as 别名]
# 或者: from plone.resourceeditor.browser.FileManager import move [as 别名]
    def test_move_exists(self):
        from plone.resourceeditor.browser import FileManager
        r = self._make_directory()
        r.makeDirectory("alpha")
        r['alpha'].writeFile("test.txt", "bar")
        r.writeFile("test.txt", "foo")

        view = FileManager(r, self.layer['request'])

        info = view.move("/test.txt", "/alpha")

        self.assertEqual(info['code'], 1)
        self.assertNotEqual(info['error'], '')
        self.assertEqual(info['newPath'], '/alpha/test.txt')

        self.assertTrue('test.txt' in r)
        self.assertEqual("bar", r['alpha'].readFile('test.txt'))
开发者ID:CGTIC,项目名称:Plone_SP,代码行数:19,代码来源:tests.py


注:本文中的plone.resourceeditor.browser.FileManager.move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。