예제 #1
0
def writeAttestedStrWithFolderPathStrAndMethodStrAndAttestVariable(
	_FolderPathStr,_MethodStr,_AttestVariable):

	#Bind with TestedStr setting
	Printer.PrintIdBool=False
	AttestedStr=Printer.getPrintStr(_AttestVariable)
	Printer.PrintIdBool=True

	#Debug
	'''
	print('l 52 Attester')
	print('_FolderPathStr is ',_FolderPathStr)
	print('')
	'''

	#Check that there is a Folder Tests
	if os.path.isdir(_FolderPathStr)==False:
		os.popen('mkdir '+_FolderPathStr)
	elif os.popen("ls "+_FolderPathStr).read()!="":
		os.popen("cd "+_FolderPathStr+";rm *")

	#Write the TestedStr
	File=open(_FolderPathStr+_MethodStr+'.txt','w')
	File.write(AttestedStr)
	File.close()
예제 #2
0
	def test(_InstanceVariable):

		#Debug
		'''
		print('Tester l 62')
		print('_FolderPathStr is '+_FolderPathStr)
		print('AttestUnboundMethodStr is '+AttestUnboundMethodStr)
		print('')
		'''
		
		#Get the AssertedStr
		File=open(_FolderPathStr+AttestUnboundMethodStr+'.txt','r')
		AttestStr=File.read()
		File.close()

		#Call the attest function to get the TestVariable
		TestVariable=_AttestUnboundMethod(
						getattr(
							SYS,
							SYS.getClassStrWithNameStr(
								TestModule.__name__.split('.')[-1]
								if '.' in TestModule.__name__ else TestModule
							)
						)()
					)

		#Bind with TestStr setting
		Printer.RepresentingIdBool=False
		TestStr=Printer.getPrintStr(TestVariable)
		Printer.RepresentingIdBool=True

		#Represent maybe
		if TestModule.TestingPrintIsBool:

			#debug
			print("\n###########################################")
			print("")
			print('AttestStr is :')
			print(AttestStr)
			print("")

			#debug
			print('TestStr is :')
			print(TestStr)
			print("")

		#Assert
		#print("a",AssertingStr)
		#print("b",_InstanceVariable.TestedPointer.TestStr)

		#assert
		_InstanceVariable.assertEqual(
				#1,1
				AttestStr,
				TestStr
		)