36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
global print_log, sendFeedback, sys, inspect, os, traceback
|
|
import sys, inspect, os, traceback
|
|
|
|
class TestingTool:
|
|
|
|
pippo = 'pippo'
|
|
deviceName = ''
|
|
testName = ''
|
|
testPath = ''
|
|
|
|
def __init__(self, testName, testPath, DEVICE):
|
|
self.deviceName = DEVICE
|
|
self.testName = testName
|
|
self.testPath = testPath
|
|
|
|
def print_log(self, text):
|
|
import time
|
|
time.ctime()
|
|
now = time.strftime('%Y.%m.%d %H:%M:%S')
|
|
print now + ' ' + DEVICE + ' - ' + testName + ': ' + str(text)
|
|
|
|
#prepare and send feedback to calling tool
|
|
def sendFeedback(self, returnString, testPassed):
|
|
print_log(testName, DEVICE, 'End of test. Result:')
|
|
print_log(testName, DEVICE, 'Device: ' + self.deviceName)
|
|
print_log(testName, DEVICE, 'Test name: ' + self.testName)
|
|
print_log(testName, DEVICE, 'Test path: ' + self.testPath)
|
|
print_log(testName, DEVICE, 'Test passed: ' + str(testPassed))
|
|
print_log(testName, DEVICE, 'Return string: ' + returnString)
|
|
ret = [self.testPath, self.deviceName, returnString, testPassed]
|
|
return ret
|
|
|
|
|
|
|
|
def print_pio(self):
|
|
print 'piopio' |