kopia lustrzana https://github.com/bristol-seds/pico-tracker
45 wiersze
1.2 KiB
Python
45 wiersze
1.2 KiB
Python
#!/usr/bin/env python
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Imports
|
|
# ------------------------------------------------------------------------------
|
|
|
|
import sys
|
|
sys.path.append("./test")
|
|
import main
|
|
|
|
from random import randint
|
|
|
|
# ------------------------------------------------------------------------------
|
|
# Test Script
|
|
# ------------------------------------------------------------------------------
|
|
|
|
class analogue_read_tc:
|
|
def __init__(self):
|
|
self.name = self.__class__.__name__
|
|
self.iterations = 20
|
|
|
|
|
|
def get_test(self):
|
|
"""Returns some suitable test parameters"""
|
|
params = main.struct_analogue_read_tc_params()
|
|
|
|
"""
|
|
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
|
|
"""
|
|
print_info("Battery: {}V".format(result["battery"]))
|
|
print_info("Solar: {}V".format(result["solar"]))
|
|
print_info("Thermistor: {}degC".format(result["thermistor"]))
|
|
|
|
return True
|