From 4d4d5522b29094838a9e13c2e9c7e29ea553c540 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Wed, 2 Sep 2015 11:10:11 +0200 Subject: [PATCH] Closedown --- script/local.py | 39 ++++++++++++++++++- .../PS Tests/power-supply-A/power-supply-A.py | 6 +-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/script/local.py b/script/local.py index 3f00f7f..b15ff9c 100644 --- a/script/local.py +++ b/script/local.py @@ -4,4 +4,41 @@ #Uncomment this line to create the simulated devices needed to the tutorial scripts. -#run("tutorial/devices") \ No newline at end of file +#run("tutorial/devices") + +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, deviceName): + self.deviceName = deviceName + 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 + ' ' + self.deviceName + ' - ' + self.testName + ': ' + str(text) + + #prepare and send feedback to calling tool + def sendFeedback(self, returnString, testPassed): + self.print_log('End of test. Result:') + self.print_log('Device: ' + self.deviceName) + self.print_log('Test name: ' + self.testName) + self.print_log('Test path: ' + self.testPath) + self.print_log('Test passed: ' + str(testPassed)) + self.print_log('Return string: ' + returnString) + ret = [self.testPath, self.deviceName, returnString, testPassed] + set_return( ret) + + + + def print_pio(self): + print 'piopio' \ No newline at end of file diff --git a/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py b/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py index 9e8051b..4f17226 100644 --- a/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py +++ b/script/tests/tests/PS Tests/power-supply-A/power-supply-A.py @@ -1,15 +1,15 @@ ######################################### ###### DO NOT MODIFY THE CODE BELOW ##### ######################################### -global print_log, sendFeedback, sys, inspect, os, traceback, testcommons -import sys, inspect, os, traceback, testcommons +global sendFeedback, sys, inspect, os, traceback +import sys, inspect, os, traceback def startTest(testName, DEVICE, params): #get the path of this script import inspect testPath = inspect.getfile(inspect.currentframe()) - test = testcommons.TestingTool(testName, DEVICE, testPath) + test = TestingTool(testName, DEVICE, testPath) test.print_pio() #by default, failed ret = 'Test failed'