本文整理汇总了Python中MAST.utility.MASTFile.to_unique_file方法的典型用法代码示例。如果您正苦于以下问题:Python MASTFile.to_unique_file方法的具体用法?Python MASTFile.to_unique_file怎么用?Python MASTFile.to_unique_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MAST.utility.MASTFile
的用法示例。
在下文中一共展示了MASTFile.to_unique_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
# 需要导入模块: from MAST.utility import MASTFile [as 别名]
# 或者: from MAST.utility.MASTFile import to_unique_file [as 别名]
newfile.data.append(" def tearDown(self):" + '\n')
newfile.data.append(" pass" + '\n')
newfile.data.append("\n")
for line in myfile.data:
if "def " in line.strip()[0:4]:
defline = line
print defline
if not "self" in defline:
partone = myfile.get_segment(defline,"def ","(").strip()
parttwo = myfile.get_segment(defline,"(",":")
parttwo.strip()
newfile.data.append(" def test_" + partone + "(self):" + '\n')
newfile.data.append(" raise SkipTest\n")
newfile.data.append(" #self.testclass." + partone + "(" + parttwo+'\n')
newfile.data.append("\n")
else:
partone = myfile.get_segment(defline,"def ","(self").strip()
parttwo = myfile.get_segment(defline,"self,",":")
if parttwo == None:
parttwo = myfile.get_segment(defline,"self",":")
parttwo.strip()
newfile.data.append(" def test_" + partone + "(self):" + '\n')
newfile.data.append(" raise SkipTest\n")
newfile.data.append(" #self.testclass." + partone + "(" + parttwo+'\n')
newfile.data.append("\n")
newfile.to_unique_file(os.getcwd(), "test_" + basename, ".py")