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

Python utilityFunctions.removeDir函数代码示例

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

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



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

示例1: test_readGroups01

    def test_readGroups01(self):
        fileContents = textwrap.dedent("""
                                       gcc, *, * {
                                           ccompiler = gcc
                                           cflags = -O0
                                           testVariable = baseVar
                                       }

                                       gcc, release, * {
                                           cflags = -O2
                                           testVariable = releaseVar
                                       }

                                       """)
        try:
            tempDir = mdTestUtilities.makeTempDir()
            filePath = mdTestUtilities.makeTempFile(tempDir, fileContents)
            groups = overrides.readGroups(filePath)
            self.assertNotEquals(groups, None, "readGroups() failed to read groups")
            self.assertEquals(len(groups), 2, "Wrong number of groups returned")
            self.assertEquals(groups[0].compiler, "gcc", "readGroups() has wrong information")
            self.assertEquals(groups[0].optimization, "*", "readGroups() has wrong information")
            self.assertEquals(groups[0].parallel, "*", "readGroups() has wrong information")
            self.assertEquals(fullCount(groups[0]), 3, "readGroups() has wrong information")
            self.assertEquals(groups[0]["ccompiler"], "gcc", "readGroups() has wrong information")
            self.assertEquals(groups[0]["cflags"], "-O0", "readGroups() has wrong information")
            self.assertEquals(groups[0].defines["testvariable"], "baseVar", "readGroups() has wrong information")
            self.assertEquals(groups[1].compiler, "gcc", "readGroups() has wrong information")
            self.assertEquals(groups[1].optimization, "release", "readGroups() has wrong information")
            self.assertEquals(groups[1].parallel, "*", "readGroups() has wrong information")
            self.assertEquals(fullCount(groups[1]), 2, "readGroups() has wrong information")
            self.assertEquals(groups[1]["cflags"], "-O2", "readGroups() has wrong information")
            self.assertEquals(groups[1].defines["testvariable"], "releaseVar", "readGroups() has wrong information")
        finally:
            utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:35,代码来源:test_overrides.py


示例2: test_getDependencies2

 def test_getDependencies2(self):
     try:
         tempDir = mdTestUtilities.copyDirToTempDir("cases/cmake/hello/hello1")
         dependencies = cmake.getDependencies(tempDir, verbose=False)
         self.assertEquals(dependencies, [], "Wrong dependencies found in CMake project")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:7,代码来源:test_cmake.py


示例3: test_pathExists2

 def test_pathExists2(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tempFile = mdTestUtilities.makeTempFile(tempDir)
         self.assertEquals(utilityFunctions.pathExists(tempFile, True), True, "pathExists should have returned True")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:7,代码来源:test_utilityFunctions.py


示例4: test_AutoToolsSimpleGraph

    def test_AutoToolsSimpleGraph(self):
        try:
            mixDownPath = os.path.abspath("..")
            origPath = os.environ["PATH"]
            os.environ["PATH"] = mixDownPath + ":" + origPath
            tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools")

            importRC = utilityFunctions.executeSubProcess("mixdown --import " + os.path.join(tempDir, "TestCaseA") + " " + os.path.join(tempDir, "TestCaseB") + " " + os.path.join(tempDir, "TestCaseC") + " " + os.path.join(tempDir, "TestCaseD"), tempDir)
            self.assertEquals(importRC, 0, "AutoTools Simple Graph test case failed import.")
            self.assertEquals(os.path.exists(os.path.join(tempDir, "TestCaseA.md")), True, "MixDown project file does not exist after importing AutoTools Simple Graph test case.")

            buildRC = utilityFunctions.executeSubProcess("mixdown TestCaseA.md -ptestPrefix", tempDir)
            self.assertEquals(buildRC, 0, "AutoTools Simple Graph test case failed build.")

            cleanRC = utilityFunctions.executeSubProcess("mixdown --clean TestCaseA.md", tempDir)
            self.assertEquals(cleanRC, 0, "AutoTools Simple Graph test case failed clean.")

            prefix = os.path.join(tempDir, "testPrefix")
            binDir = os.path.join(prefix, "bin")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseA")), True, "Executable A does not exist after building AutoTools Simple Graph test case.")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseB")), True, "Executable B does not exist after building AutoTools Simple Graph test case.")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseC")), True, "Executable C does not exist after building AutoTools Simple Graph test case.")
            self.assertEquals(os.path.exists(os.path.join(binDir, "TestCaseD")), True, "Executable D does not exist after building AutoTools Simple Graph test case.")
        finally:
            utilityFunctions.removeDir(tempDir)
            os.environ["PATH"] = origPath
开发者ID:tepperly,项目名称:MixDown,代码行数:26,代码来源:test_MixDownShort.py


示例5: test_findExecutables07

    def test_findExecutables07(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()

            mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))

            aDir = os.path.join(tempDir, 'a')
            aGccExe = os.path.join(aDir, "gcc")
            mdTestUtilities.createBlankFile(aGccExe)
            mdTestUtilities.makeFileExecutable(aGccExe)

            bDir = os.path.join(tempDir, 'b')
            bIccExe = os.path.join(bDir, "icc")
            mdTestUtilities.createBlankFile(bIccExe)
            mdTestUtilities.makeFileExecutable(bIccExe)

            acDir = os.path.join(os.path.join(tempDir, 'a'), 'c')
            acIccExe = os.path.join(acDir, "icc")
            mdTestUtilities.createBlankFile(acIccExe)
            mdTestUtilities.makeFileExecutable(acIccExe)

            exes = profiler.findExecutables([(tempDir, True)], ["icc", "gcc"])
            self.assertEquals(len(exes), 3, "profiler.findExecutables did not find the right amount of executables")
            self.assertTrue(aGccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(bIccExe in exes, "profiler.findExecutables did not find the right executable")
            self.assertTrue(acIccExe in exes, "profiler.findExecutables did not find the right executable")
        finally:
            utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:28,代码来源:test_profiler.py


示例6: test_isAutoToolsProject4

 def test_isAutoToolsProject4(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tempFile = os.path.join(tempDir, "configure.ac")
         mdTestUtilities.createBlankFile(tempFile)
         self.assertTrue(autoTools.isAutoToolsProject(tempDir), "Failed to detect AutoTools project.")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:8,代码来源:test_autoTools.py


示例7: test_getDependenciesFalse2

 def test_getDependenciesFalse2(self):
     # False positive
     try:
         tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools/TestCaseB")
         dependencies = cmake.getDependencies(tempDir, verbose=False)
         self.assertEquals(dependencies, None, "Wrong dependencies found in CMake project")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:8,代码来源:test_cmake.py


示例8: test_isCMakeProject2

 def test_isCMakeProject2(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tempFile = os.path.join(tempDir, "CMakeLists.txt")
         mdTestUtilities.createBlankFile(tempFile)
         self.assertTrue(cmake.isCMakeProject(tempDir), "Failed to detect CMake project.")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:8,代码来源:test_cmake.py


示例9: test_getDependencies6

 def test_getDependencies6(self):
     #False positive
     try:
         tempDir = mdTestUtilities.copyDirToTempDir("cases/cmake/hello/hello1")
         dependencies = autoTools.getDependencies(tempDir, verbose=False)
         self.assertEquals(dependencies, None, "Wrong dependencies found in AutoTools project")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:8,代码来源:test_autoTools.py


示例10: test_generateConfigureFiles

 def test_generateConfigureFiles(self):
     try:
         tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools/TestCaseA")
         success = autoTools.generateConfigureFiles(tempDir, "testCaseTarget", False)
         self.assertEquals(success, True, "Unable to generate configure files.")
         self.assertEquals(os.path.exists(os.path.join(tempDir, "configure")), True, "Configure files did not exist after calling generateConfigureFiles.")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:8,代码来源:test_autoTools.py


示例11: test_getDependencies4

 def test_getDependencies4(self):
     try:
         tempDir = mdTestUtilities.copyDirToTempDir("cases/simpleGraphAutoTools/TestCaseD")
         success = autoTools.generateConfigureFiles(tempDir, "testCaseTarget", False)
         self.assertEquals(success, True, "Unable to generate build files.")
         dependencies = autoTools.getDependencies(tempDir, verbose=False)
         self.assertEquals(dependencies, [], "Wrong dependencies found in AutoTools project")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:9,代码来源:test_autoTools.py


示例12: test_findExecutables06

 def test_findExecutables06(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         testExe = os.path.join(tempDir, "gcc")
         mdTestUtilities.createBlankFile(testExe)
         mdTestUtilities.createBlankFile(os.path.join(tempDir, "test"))
         exes = profiler.findExecutables([(tempDir, True)], ["gcc"])
         self.assertEquals(len(exes), 0, "profiler.findExecutables did not find the right amount of executables")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:10,代码来源:test_profiler.py


示例13: test_pathExists4

 def test_pathExists4(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         self.assertEquals(
             utilityFunctions.pathExists(os.path.join(tempDir, "test"), True),
             False,
             "pathExists should have returned False",
         )
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:10,代码来源:test_utilityFunctions.py


示例14: test_targetPathToName01

 def test_targetPathToName01(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tarDir, tarName = mdTestUtilities.createBzipFile(tempDir)
         tarPath = os.path.join(tempDir, tarName)
         path = os.path.join(tempDir, "apr-1.4.5.tar.bz2")
         shutil.move(tarPath, path)
         name = target.targetPathToName(path)
         self.assertEquals(name, "apr", "Wrong name returned")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:11,代码来源:test_target.py


示例15: test_fetchURL

 def test_fetchURL(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tarDir, tarName = mdTestUtilities.createGzipFile(tempDir)
         urlPath = "http://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz"
         pci = createPythonCallInfo(urlPath, os.path.join(tempDir, "output"), os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True, "Gzip file failed to fetch from URL.")
         self.assertEqual(os.path.exists(pci.currentPath), True, "Gzip file did not exist after fetching.")
         self.assertEqual(tarfile.is_tarfile(pci.currentPath), True, "Gzip file was not a tar file after fetching.")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:12,代码来源:test_steps.py


示例16: test_validate02

    def test_validate02(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()
            projectFilePath = os.path.join(tempDir, "test.md")
            mdTestUtilities.createBlankFile(projectFilePath)

            testOptions = options.Options()
            commandline = "MixDown " + projectFilePath + " -ptestPrefix -v -ggcc,debug,parallel"
            self.assertEquals(testOptions.processCommandline(commandline.split(" ")), True, "Command-line should have processed correctly")
            self.assertEquals(testOptions.validate(), False, "Command-line options should not have validated")
        finally:
            utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:12,代码来源:test_options.py


示例17: test_fetchTar

 def test_fetchTar(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         tarDir, tarName = mdTestUtilities.createTarFile(tempDir)
         tarPath = os.path.join(tempDir, tarName)
         pci = createPythonCallInfo(tarPath, os.path.join(tempDir, "output"), os.path.join(tempDir, "download"))
         pci = steps.fetch(pci)
         self.assertEqual(pci.success, True, "Local tar file failed to fetch.")
         self.assertEqual(os.path.exists(pci.currentPath), True, "Tar file did not exist after fetching.")
         self.assertEqual(tarfile.is_tarfile(pci.currentPath), True, "Tar file was not a tar file after fetching.")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:12,代码来源:test_steps.py


示例18: test_pathExists5

 def test_pathExists5(self):
     try:
         tempDir = mdTestUtilities.makeTempDir()
         directory = os.path.join(tempDir, "testDir")
         os.makedirs(directory)
         mdTestUtilities.createBlankFile(os.path.join(directory, "test"))
         wrongPath = os.path.join(os.path.join(tempDir, "TeStDiR"), "test")
         self.assertEquals(
             utilityFunctions.pathExists(wrongPath, True), False, "pathExists should have returned False"
         )
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:12,代码来源:test_utilityFunctions.py


示例19: test_processCommandline09

    def test_processCommandline09(self):
        try:
            tempDir = mdTestUtilities.makeTempDir()
            tarDir, tarFile = mdTestUtilities.createTarFile(tempDir)
            tarPath = os.path.join(tempDir, tarFile)

            testOptions = options.Options()
            commandline = "MixDown " + tarPath + " --import --clean"
            self.assertEquals(testOptions.processCommandline(commandline.split(" ")), False, "Command-line should not have processed correctly")
            self.assertEquals(testOptions.targetsToImport, [], "targetsToImport should have not been set")
        finally:
            utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:12,代码来源:test_options.py


示例20: test_gitCheckout

 def test_gitCheckout(self):
     if not git.isGitInstalled():
         self.fail("Git is not installed on your system.  All Git tests will fail.")
     tempDir = mdTestUtilities.makeTempDir()
     tempRepo = mdTestUtilities.createGitRepository(tempDir)
     checkedOutRepo = os.path.join(tempDir, "checkedOut")
     try:
         git.gitCheckout(tempRepo, checkedOutRepo)
         returnValue = os.path.exists(os.path.join(checkedOutRepo, mdTestUtilities.testFileName))
         self.assertEqual(returnValue, True, "'" + mdTestUtilities.testFileName + "' did not exist after git.gitCheckout(" + tempRepo + ") was called.")
     finally:
         utilityFunctions.removeDir(tempDir)
开发者ID:tepperly,项目名称:MixDown,代码行数:12,代码来源:test_git.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python md5.md5函数代码示例发布时间:2022-05-27
下一篇:
Python md.get_default_access_token函数代码示例发布时间: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