• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.removeDir函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test.utils.removeDir函数的典型用法代码示例。如果您正苦于以下问题:Python removeDir函数的具体用法?Python removeDir怎么用?Python removeDir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: testPageSelectLoad

    def testPageSelectLoad(self):
        Application.onPageSelect += self.pageSelect

        removeDir(self.path)

        rootwiki = WikiDocument.create(self.path)
        TextPageFactory().create(rootwiki, u"Страница 1", [])
        TextPageFactory().create(rootwiki, u"Страница 2", [])
        TextPageFactory().create(rootwiki[u"Страница 2"], u"Страница 3", [])

        document = WikiDocument.load(self.path)
        Application.wikiroot = document

        self.assertEqual(document.selectedPage, None)

        document.selectedPage = document[u"Страница 1"]

        self.assertEqual(document.selectedPage, document[u"Страница 1"])
        self.assertEqual(self.isPageSelect, True)
        self.assertEqual(self.pageSelectSender, document[u"Страница 1"])
        self.assertEqual(self.pageSelectCount, 1)

        document.selectedPage = document[u"Страница 2/Страница 3"]

        self.assertEqual(document.selectedPage, document[u"Страница 2/Страница 3"])
        self.assertEqual(self.isPageSelect, True)
        self.assertEqual(self.pageSelectSender, document[u"Страница 2/Страница 3"])
        self.assertEqual(self.pageSelectCount, 2)

        Application.onPageSelect -= self.pageSelect
开发者ID:theoden-dd,项目名称:outwiker,代码行数:30,代码来源:event.py


示例2: testReloading

    def testReloading (self):
        attach = Attachment (self.page)
        attach.attach (self.fullFilesPath)

        self.wikiroot.selectedPage = self.page
        Application.wikiroot = self.wikiroot

        self.assertEqual (self.wnd.attachPanel.panel.attachList.GetItemCount(), len (self.fullFilesPath))

        # Создадим другую независимую вики
        newpath = mkdtemp (prefix=u'Абыр Абырвалг')
        newwikiroot = WikiDocument.create (newpath)

        TextPageFactory().create (newwikiroot, u"Новая страница 1", [])
        TextPageFactory().create (newwikiroot, u"Новая страница 2", [])

        filesPath = u"../test/samplefiles/"
        newfiles = [u"accept.png", u"add.png", u"anchor.png"]
        newfullFilesPath = [os.path.join (filesPath, fname) for fname in newfiles]

        newattach = Attachment (newwikiroot[u"Новая страница 1"])
        newattach.attach (newfullFilesPath)
        newwikiroot.selectedPage = newwikiroot[u"Новая страница 1"]

        Application.wikiroot = newwikiroot
        self.assertEqual (self.wnd.attachPanel.panel.attachList.GetItemCount(), len (newfullFilesPath))

        Application.wikiroot.selectedPage = None
        Application.wikiroot = None
        removeDir (newpath)
开发者ID:LihMeh,项目名称:outwiker,代码行数:30,代码来源:attach.py


示例3: testUpdateIconNoEvent

    def testUpdateIconNoEvent(self):
        """
        Тест на НЕсрабатывание событий при обновлении иконки, если не устанолен Application.wikiroot
        """
        Application.wikiroot = None

        Application.onPageUpdate += self.pageUpdate
        Application.onTreeUpdate += self.treeUpdate

        removeDir(self.path)

        self.assertFalse(self.isTreeUpdate)
        self.assertFalse(self.isPageUpdate)
        self.assertFalse(self.isPageCreate)

        # Создаем вики
        rootwiki = WikiDocument.create(self.path)
        TextPageFactory().create(rootwiki, u"Страница 1", [])

        Application.wikiroot = rootwiki

        # Изменим содержимое страницы
        rootwiki[u"Страница 1"].icon = "../test/images/feed.gif"

        self.assertTrue(self.isPageUpdate)
        self.assertEqual(self.pageUpdateSender, rootwiki[u"Страница 1"])

        self.assertFalse(self.isTreeUpdate)

        Application.onPageUpdate -= self.pageUpdate
        Application.onTreeUpdate -= self.treeUpdate
开发者ID:theoden-dd,项目名称:outwiker,代码行数:31,代码来源:event.py


示例4: tearDown

 def tearDown(self):
     Tester.dialogTester.clear()
     self.application.wikiroot = None
     removeDir(self.wikiroot.path)
     self._loader.clear()
     self.destroyApplication()
     self.destroyWiki(self.wikiroot)
开发者ID:Jenyay,项目名称:outwiker,代码行数:7,代码来源:test_changepageuid.py


示例5: tearDown

 def tearDown(self):
     self.application.selectedPage = None
     self.application.wikiroot = None
     self.loader.clear()
     self.destroyApplication()
     if os.path.exists(self.path):
         removeDir(self.path)
开发者ID:Jenyay,项目名称:outwiker,代码行数:7,代码来源:test_webpage.py


示例6: testUpdateIcon

    def testUpdateIcon(self):
        """
        Тест на срабатывание событий при обновлении иконки
        """
        Application.onPageUpdate += self.pageUpdate
        Application.onTreeUpdate += self.treeUpdate

        removeDir(self.path)

        self.assertFalse(self.isTreeUpdate)
        self.assertFalse(self.isPageUpdate)
        self.assertFalse(self.isPageCreate)

        # Создаем вики
        rootwiki = WikiDocument.create(self.path)
        TextPageFactory().create(rootwiki, u"Страница 1", [])

        Application.wikiroot = rootwiki

        # Изменим содержимое страницы
        rootwiki[u"Страница 1"].icon = "../test/images/feed.gif"

        self.assertTrue(self.isPageUpdate)
        self.assertEqual(self.pageUpdateSender, rootwiki[u"Страница 1"])
        self.assertEqual(self.prev_kwargs["change"], PAGE_UPDATE_ICON)

        self.assertFalse(self.isTreeUpdate)

        Application.onPageUpdate -= self.pageUpdate
        Application.onTreeUpdate -= self.treeUpdate
开发者ID:theoden-dd,项目名称:outwiker,代码行数:30,代码来源:event.py


示例7: testUpdateTagsEvent

    def testUpdateTagsEvent(self):
        """
        Тест на срабатывание событий при обновлении меток (тегов)
        """
        Application.onPageUpdate += self.pageUpdate

        removeDir(self.path)

        self.assertFalse(self.isTreeUpdate)
        self.assertFalse(self.isPageUpdate)
        self.assertFalse(self.isPageCreate)

        # Создаем вики
        rootwiki = WikiDocument.create(self.path)
        TextPageFactory().create(rootwiki, u"Страница 1", [])

        Application.wikiroot = rootwiki

        # Изменим содержимое страницы
        rootwiki[u"Страница 1"].tags = ["test"]

        self.assertTrue(self.isPageUpdate)
        self.assertEqual(self.pageUpdateSender, rootwiki[u"Страница 1"])
        self.assertEqual(self.prev_kwargs["change"], PAGE_UPDATE_TAGS)

        Application.onPageUpdate -= self.pageUpdate
开发者ID:theoden-dd,项目名称:outwiker,代码行数:26,代码来源:event.py


示例8: testUpdateContentEvent

    def testUpdateContentEvent(self):
        """
        Тест на срабатывание событий при обновлении контента
        """
        Application.onPageUpdate += self.pageUpdate

        removeDir(self.path)

        self.assertFalse(self.isTreeUpdate)
        self.assertFalse(self.isPageUpdate)
        self.assertFalse(self.isPageCreate)

        # Создаем вики
        rootwiki = WikiDocument.create(self.path)
        TextPageFactory().create(rootwiki, u"Страница 1", [])

        Application.wikiroot = rootwiki

        # Изменим содержимое страницы
        rootwiki[u"Страница 1"].content = "1111"

        self.assertTrue(self.isPageUpdate)
        self.assertEqual(self.pageUpdateSender, rootwiki[u"Страница 1"])
        self.assertEqual(self.prev_kwargs["change"], PAGE_UPDATE_CONTENT)

        Application.onPageUpdate -= self.pageUpdate
        Application.wikiroot = None
开发者ID:theoden-dd,项目名称:outwiker,代码行数:27,代码来源:event.py


示例9: tearDown

 def tearDown (self):
     from sessions.sessionstorage import SessionStorage
     super (SessionsTest, self).tearDown ()
     Application.wikiroot = None
     Application.config.remove_section (SessionStorage.SECTION_NAME)
     self.loader.clear()
     removeDir (self.path2)
开发者ID:LihMeh,项目名称:outwiker,代码行数:7,代码来源:sessions_test.py


示例10: tearDown

    def tearDown(self):
        Application.wikiroot = None

        removeDir(self.path)
        self._dlg.Destroy()
        self._loader.clear()

        BaseMainWndTest.tearDown(self)
开发者ID:theoden-dd,项目名称:outwiker,代码行数:8,代码来源:changepageuid_test.py


示例11: tearDown

 def tearDown(self):
     from sessions.sessionstorage import SessionStorage
     self.application.wikiroot = None
     self.application.config.remove_section(SessionStorage.SECTION_NAME)
     self.loader.clear()
     removeDir(self.path2)
     self.destroyApplication()
     self.destroyWiki(self.wikiroot)
开发者ID:Jenyay,项目名称:outwiker,代码行数:8,代码来源:test_sessions.py


示例12: __createWiki

    def __createWiki(self):
        # Здесь будет создаваться вики
        self.path = "../test/testwiki"
        removeDir(self.path)

        self.rootwiki = WikiDocument.create(self.path)

        WikiPageFactory().create(self.rootwiki, "Страница 1", [])
        self.testPage = self.rootwiki["Страница 1"]
开发者ID:Jenyay,项目名称:outwiker,代码行数:9,代码来源:test_organizer.py


示例13: testSaveLoad_03

    def testSaveLoad_03(self):
        depot = PageUidDepot()
        uid = depot.createUid(self.wikiroot["Страница 1"])

        depot_new = PageUidDepot(self.wikiroot)

        self.assertEqual(depot_new[uid].title, "Страница 1")

        removeDir(self.path)
开发者ID:Jenyay,项目名称:outwiker,代码行数:9,代码来源:test_pageuiddepot.py


示例14: tearDown

    def tearDown(self):
        Application.wikiroot = None
        os.chmod (self._getConfigPath (self.wikiroot), stat.S_IRUSR | stat.S_IXUSR | stat.S_IWUSR)
        os.chmod (self._getConfigPath (self.wikiroot[u"Страница 1"]), stat.S_IRUSR | stat.S_IXUSR | stat.S_IWUSR)

        if self.wikiroot[u"Страница 2"] is not None:
            os.chmod (self._getConfigPath (self.wikiroot[u"Страница 2"]), stat.S_IRUSR | stat.S_IXUSR | stat.S_IWUSR)

        removeDir (self.path)
开发者ID:LihMeh,项目名称:outwiker,代码行数:9,代码来源:treecreation.py


示例15: tearDown

    def tearDown (self):
        wx.GetApp().Yield()
        self.wnd.Close()
        self.wnd.Hide()
        self._processEvents()

        Application.mainWindow = None
        Application.selectedPage = None
        Application.wikiroot = None
        removeDir (self.path)
开发者ID:theoden-dd,项目名称:outwiker,代码行数:10,代码来源:basemainwnd.py


示例16: tearDown

    def tearDown (self):
        # obj = Application.actionController

        wx.GetApp().Yield()
        self.wnd.Close()
        self.wnd.Hide()
        self._processEvents()

        Application.mainWindow = None
        Application.selectedPage = None
        Application.wikiroot = None
        Application.actionController.destroy()
        Application.actionController = None
        removeDir (self.path)
        self.wnd = None
开发者ID:LihMeh,项目名称:outwiker,代码行数:15,代码来源:basemainwnd.py


示例17: __createInvalidWiki2

        def __createInvalidWiki2():
            # Здесь будет создаваться вики
            path = mkdtemp(prefix='Абырвалг абыр')
            removeDir(path)

            rootwiki = WikiDocument.create(path)

            factory = TextPageFactory()
            factory.create(rootwiki, "Страница 1", [])
            factory.create(rootwiki["Страница 1"], "Страница 2", [])

            # Испортим файл __page.opt
            with open(os.path.join(rootwiki.path, "__page.opt"), "w") as fp:
                fp.write("[General]\naaa=xxx\n<<<<<<<<wsfsdf sdf sdfasdfdsf \nasfasdsadf")

            return path
开发者ID:Jenyay,项目名称:outwiker,代码行数:16,代码来源:test_invalidwiki.py


示例18: setUp

    def setUp(self):
        self.outputdir = "../test/temp"
        self.pluginname = u"Export2Html"

        self.path = u"../test/samplewiki"
        self.root = WikiDocument.load(self.path)

        dirlist = [u"../plugins/export2html"]

        self.loader = PluginsLoader(Application)
        self.loader.load(dirlist)

        removeDir(self.outputdir)

        os.mkdir(self.outputdir)

        Application.wikiroot = None
开发者ID:theoden-dd,项目名称:outwiker,代码行数:17,代码来源:export2html_test.py


示例19: testPageSelectCreateNoEvent

    def testPageSelectCreateNoEvent(self):
        Application.onPageSelect += self.pageSelect

        removeDir(self.path)

        rootwiki = WikiDocument.create(self.path)
        TextPageFactory().create(rootwiki, u"Страница 1", [])
        TextPageFactory().create(rootwiki, u"Страница 2", [])
        TextPageFactory().create(rootwiki[u"Страница 2"], u"Страница 3", [])

        Application.wikiroot = rootwiki

        self.assertEqual(rootwiki.selectedPage, None)

        rootwiki.selectedPage = rootwiki[u"Страница 1"]

        self.assertEqual(rootwiki.selectedPage, rootwiki[u"Страница 1"])
        self.assertEqual(self.isPageSelect, True)
开发者ID:theoden-dd,项目名称:outwiker,代码行数:18,代码来源:event.py


示例20: testUpdateContentNoEvent

    def testUpdateContentNoEvent(self):
        """
        Тест на НЕсрабатывание событий при обновлении контента
        """
        Application.onPageUpdate += self.pageUpdate

        removeDir(self.path)

        self.assertFalse(self.isTreeUpdate)
        self.assertFalse(self.isPageUpdate)
        self.assertFalse(self.isPageCreate)

        # Создаем вики
        rootwiki = WikiDocument.create(self.path)
        TextPageFactory().create(rootwiki, u"Страница 1", [])

        # Изменим содержимое страницы
        rootwiki[u"Страница 1"].content = "1111"

        self.assertFalse(self.isPageUpdate)
        self.assertEqual(self.pageUpdateSender, None)

        Application.onPageUpdate -= self.pageUpdate
开发者ID:theoden-dd,项目名称:outwiker,代码行数:23,代码来源:event.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.removeWiki函数代码示例发布时间:2022-05-27
下一篇:
Python utils.one函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap