kopia lustrzana https://github.com/bristol-seds/pico-tracker
				
				
				
			
		
			
				
	
	
		
			44 wiersze
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Python
		
	
	
			
		
		
	
	
			44 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 adc_battery_solar_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_adc_battery_solar_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"]))
 | |
| 
 | |
|         return True
 |