def test_testName(self):
		color.blue("test here baby")
		inputText = """
	def dataFile(self):
		return os.path.join (self.dataFolder, 'iterations.data')






	def currentFile(self):
		return os.path.join (self.dataFolder, 'current.data')
"""
		expected = """
	def dataFile(self):
		return os.path.join (self.dataFolder, 'iterations.data')


	def currentFile(self):
		return os.path.join (self.dataFolder, 'current.data')"""
		result = beatyModel.py(inputText)	
		color.red("inputText")
		print(repr(inputText))
		print(inputText)
		assertMy.stringDiffByLines(result, expected)
	def test_testName(self):
		color.blue("test here baby")
		inputText = """
	def currentFile(self):
		return os.path.join (self.dataFolder, 'current.data')

	 


	def testFolder(self):	
		self.dataFolder = "/Users/maks/Library/Application Support/Sublime Text 3/Packages/workflow/testData"
"""
		expected = """
	def currentFile(self):
		return os.path.join (self.dataFolder, 'current.data')


	def testFolder(self):	
		self.dataFolder = "/Users/maks/Library/Application Support/Sublime Text 3/Packages/workflow/testData"
		"""
		result = beatyModel.py(inputText)	
		color.red("inputText")
		print(repr(inputText))
		print(inputText)
		assertMy.stringDiffByLines(result, expected)
	def test_testName(self):
		color.blue("test here baby")
		inputText = """
	def test_testName(self):
		color.blue("test here baby")
		intpuText = 
		beatyModel.py(inputText)	
	def test_testName(self):
		color.blue("test here baby")
		intpuText = 
		beatyModel.py(inputText)"""
		expected = """\tdef test_testName(self):\n\t\tcolor.blue("test here baby")\n\t\tintpuText = \n\t\tbeatyModel.py(inputText)\n\n\n\tdef test_testName(self):\n\t\tcolor.blue("test here baby")\n\t\tintpuText = \n\t\tbeatyModel.py(inputText)"""
		result = beatyModel.py(inputText)	
		color.red("inputText")
		print(repr(inputText))
		print(inputText)
		assertMy.stringDiffByLines(result, expected)
Esempio n. 4
0
	def test_testName(self):
		color.blue("test here baby")
		inputText = """\tdef py(text):
	regex = "{0}print\(.+\)|{0}color\..+\)".format("\n\s+")
	replace1 = re.sub (regex, '', text)
	# result = util.clearEmptyLines(replace1)
	result = replace1
	return result
def pyFile(filename):
	fileText = filer.read(filename)
	fileText = py(fileText)
	filer.write(filename, fileText)"""
		expected = """def py(text):\n\tregex = "{0}print\\(.+\\)|{0}color\\..+\\)".format("\n\\s+")\n\treplace1 = re.sub (regex, \'\', text)\n\t# result = util.clearEmptyLines(replace1)\n\tresult = replace1\n\treturn result\n\n\ndef pyFile(filename):\n\tfileText = filer.read(filename)\n\tfileText = py(fileText)\n\tfiler.write(filename, fileText)"""
		result = beatyModel.py(inputText)	
		color.red("inputText")
		print(repr(inputText))
		print(inputText)
		assertMy.stringDiffByLines(result, expected)