本文整理汇总了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
示例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)
示例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
示例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)
示例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)
示例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
示例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
示例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
示例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)
示例10: tearDown
def tearDown(self):
Application.wikiroot = None
removeDir(self.path)
self._dlg.Destroy()
self._loader.clear()
BaseMainWndTest.tearDown(self)
示例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)
示例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"]
示例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)
示例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)
示例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)