Commit ac73b647 authored by Christopher Turner's avatar Christopher Turner

Fix formatting and naming

parent 803eb903
......@@ -19,6 +19,7 @@ class RunTests(object):
try:
self.cmdsock = self.setup_connection(hostname, cmdport)
except socket.error as e:
raise
self.console_logger.error(e)
def setup_connection(self, hostname, cmdport):
......@@ -70,7 +71,7 @@ class RunTests(object):
def print_summary(self, cls_list):
self.console_logger.info('-- SUMMARY {}'.format(''.join(['-'] * 24)))
self.console_logger.info(
'{:<10}{:<11}{:<10}'.format('TEST', 'NUMBER', 'ERRORS'))
'{:<15}{:<11}{:<10}'.format('TEST', 'NUMBER', 'ERRORS'))
self.console_logger.info('{}'.format(''.join(['-'] * 35)))
for cls in cls_list:
summary = cls.get_summary()
......@@ -78,7 +79,7 @@ class RunTests(object):
self.console_logger.info(item)
def setup_logging(logPath):
file_format = "%(asctime)s [%(levelname)-5s] [%(name)-10s] %(message)s"
file_format = "%(asctime)s [%(levelname)-5s] [%(name)-13s] %(message)s"
console_format = "%(asctime)s [%(levelname)-5s] %(message)s"
logging.basicConfig(level=logging.DEBUG,
format=file_format,
......@@ -119,9 +120,12 @@ def main(argv):
'hostname', help = 'Name or IP address of Panda device')
args = parser.parse_args()
# try:
rt = RunTests('config', args.hostname, int(args.port))
rt.run_tests()
view_log(log_path)
# except:
# print "CONNECTION ERROR"
if __name__ == '__main__':
main(sys.argv[1:])
......@@ -6,10 +6,10 @@ LVDS Loop Back (LB) test
"""
class LvdsLB(PandATest.PandATest):
class LvdsLoopBack(PandATest.PandATest):
def __init__(self, *args, **kwargs):
super(LvdsLB, self).__init__(*args, **kwargs)
super(LvdsLoopBack, self).__init__(*args, **kwargs)
self.outputs = [1, 2]
self.inputs = [1, 2]
self.ch_connect = {
......
......@@ -6,10 +6,10 @@ LVDS Unplugged (U) test
"""
class LvdsU(PandATest.PandATest):
class LvdsUnplugged(PandATest.PandATest):
def __init__(self, *args, **kwargs):
super(LvdsU, self).__init__(*args, **kwargs)
super(LvdsUnplugged, self).__init__(*args, **kwargs)
self.inputs = [1, 2]
self.outputs = [1, 2]
self.ch_connect = {
......
......@@ -42,7 +42,7 @@ class PandATest(object):
def get_summary(self):
error_count = self.test_result.count(0)
summary = ["{:<10}{:<10} ERRORS: {}".format(
summary = ["{:<15}{:<10} ERRORS: {}".format(
self.__class__.__name__,
self.blocknum,
error_count)
......
#!/bin/env dls-python
import PandATest
import LvdsLB
import TtlLB
import LvdsLoopBack
import TtlLoopBack
"""
LVDS and TTL Loop Back (LB) tests combined
......@@ -12,8 +12,8 @@ class Plugged(PandATest.PandATest):
def __init__(self, *args, **kwargs):
super(Plugged, self).__init__(*args, **kwargs)
self.lp = LvdsLB.LvdsLB(*args, **kwargs)
self.tp = TtlLB.TtlLB(*args, **kwargs)
self.lp = LvdsLoopBack.LvdsLoopBack(*args, **kwargs)
self.tp = TtlLoopBack.TtlLoopBack(*args, **kwargs)
def test_code(self):
self.logger.info('LVDS PLUGGED')
......@@ -22,11 +22,11 @@ class Plugged(PandATest.PandATest):
self.tp.test_code()
def get_summary(self):
summary = ["{:<10}{:<10} ERRORS: {}".format(
summary = ["{:<15}{:<10} ERRORS: {}".format(
self.lp.__class__.__name__,
self.blocknum,
self.lp.test_result.count(0)),
"{:<10}{:<10} ERRORS: {}".format(
"{:<15}{:<10} ERRORS: {}".format(
self.tp.__class__.__name__,
self.blocknum,
self.tp.test_result.count(0)),
......@@ -36,5 +36,5 @@ class Plugged(PandATest.PandATest):
def get_user_input(self):
inputy = '.'
while inputy not in ['']:
print "Loopback connecters connected, OK ? [return]"
print "Loopback connectors connected, OK ? [return]"
inputy = raw_input()
\ No newline at end of file
......@@ -5,10 +5,10 @@ import PandATest
TTL Loop Back (LB) test
"""
class TtlLB(PandATest.PandATest):
class TtlLoopBack(PandATest.PandATest):
def __init__(self, *args, **kwargs):
super(TtlLB, self).__init__(*args, **kwargs)
super(TtlLoopBack, self).__init__(*args, **kwargs)
self.outputs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
self.inputs = [1, 2, 3, 4, 5, 6]
self.ch_connect = {
......
......@@ -6,10 +6,10 @@ TTL Unplugged (U) test
"""
class TtlU(PandATest.PandATest):
class TtlUnplugged(PandATest.PandATest):
def __init__(self, *args, **kwargs):
super(TtlU, self).__init__(*args, **kwargs)
super(TtlUnplugged, self).__init__(*args, **kwargs)
self.outputs = [1,2,3,4,5,6,7,8,9,10]
self.inputs = [1,2,3,4,5,6]
self.ch_connect = {
......
#!/bin/env dls-python
import PandATest
import LvdsU
import TtlU
import LvdsUnplugged
import TtlUnplugged
"""
LVDS and TTL Unplugged tests
......@@ -12,8 +12,8 @@ class Unplugged(PandATest.PandATest):
def __init__(self, *args, **kwargs):
super(Unplugged, self).__init__(*args, **kwargs)
self.lu = LvdsU.LvdsU(*args, **kwargs)
self.tu = TtlU.TtlU(*args, **kwargs)
self.lu = LvdsUnplugged.LvdsUnplugged(*args, **kwargs)
self.tu = TtlUnplugged.TtlUnplugged(*args, **kwargs)
def test_code(self):
self.logger.info('LVDS UNPLUGGED')
......@@ -22,11 +22,11 @@ class Unplugged(PandATest.PandATest):
self.tu.test_code()
def get_summary(self):
summary = ["{:<10}{:<10} ERRORS: {}".format(
summary = ["{:<15}{:<10} ERRORS: {}".format(
self.lu.__class__.__name__,
self.blocknum,
self.lu.test_result.count(0)),
"{:<10}{:<10} ERRORS: {}".format(
"{:<15}{:<10} ERRORS: {}".format(
self.tu.__class__.__name__,
self.blocknum,
self.tu.test_result.count(0)),
......@@ -36,5 +36,5 @@ class Unplugged(PandATest.PandATest):
def get_user_input(self):
inputy = '.'
while inputy not in ['']:
print "Loopback connecters NOT connected, OK ? [return]"
print "Loopback connectors NOT connected, OK ? [return]"
inputy = raw_input()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment