2015-07-03 11:46:33 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Imports
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
import sys
|
|
|
|
sys.path.append("./test")
|
|
|
|
import main
|
|
|
|
|
|
|
|
from random import randint
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Test Script
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
2015-10-06 22:39:36 +00:00
|
|
|
class analogue_read_tc:
|
2015-07-03 11:46:33 +00:00
|
|
|
def __init__(self):
|
|
|
|
self.name = self.__class__.__name__
|
|
|
|
self.iterations = 20
|
|
|
|
|
|
|
|
|
|
|
|
def get_test(self):
|
|
|
|
"""Returns some suitable test parameters"""
|
2015-10-06 22:39:36 +00:00
|
|
|
params = main.struct_analogue_read_tc_params()
|
2015-07-03 11:46:33 +00:00
|
|
|
|
|
|
|
"""
|
|
|
|
Assign input parameters here
|
|
|
|
"""
|
|
|
|
|
|
|
|
return params
|
|
|
|
|
|
|
|
def is_correct(self, params, result, print_info):
|
|
|
|
"""Returns if a result is correct for the given parameters"""
|
|
|
|
|
|
|
|
"""
|
|
|
|
Compare result and params here, decide sth.
|
|
|
|
Can use print_info
|
|
|
|
"""
|
2015-10-10 19:38:02 +00:00
|
|
|
print_info("Battery: {}V".format(result["battery"]))
|
|
|
|
print_info("Solar: {}V".format(result["solar"]))
|
|
|
|
print_info("Thermistor: {}degC".format(result["thermistor"]))
|
2015-07-03 11:46:33 +00:00
|
|
|
|
|
|
|
return True
|