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


Python utils.removeDir函数代码示例

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


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


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