This adds various tests, integrated into setuptools. These use "monkey patching" where needed to mock the pyserial and packet reader/writer functionality to allow for testing with no changes. The code should be refactored to simplify testing, but this is good enough to stop regressions for now.
		
			
				
	
	
		
			19 lines
		
	
	
		
			732 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			732 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: STC12C2052AD programming test
 | |
| protocol: stc12a
 | |
| code_data: [49, 50, 51, 52, 53, 54, 55, 56, 57]
 | |
| responses:
 | |
|     - [0x00, 0x04, 0xEC, 0x04, 0xEC, 0x04, 0xEC, 0x04, 0xEC, 0x04, 0xEC, 0x04, 0xEC, 0x04, 0xEB, 0x04, 0xEB, 0x58, 0x44, 0x00, 0xF2, 0x12, 0x83, 0xFD, 0xF7, 0xF7, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFD, 0xF7, 0xF7, 0xFF]
 | |
|     - [0x8F, 0xC0, 0x79, 0x3F, 0xFE, 0x28, 0x85]
 | |
|     - [0x8E, 0xC0, 0x79, 0x3F, 0xFE, 0x28]
 | |
|     - [0x80]
 | |
|     - [0x80]
 | |
|     - [0x80]
 | |
|     - [0x80]
 | |
|     - [0x80]
 | |
|     - [0x80, 0x66]
 | |
|     - [0x80, 0x80]
 | |
|     - [0x80, 0x80]
 | |
|     - [0x80, 0x80]
 | |
|     - [0x80, 0xEE]
 | |
|     - [0x10, 0xC0, 0x16, 0xF7, 0xFF, 0xBF, 0x03, 0xFF, 0x58, 0x44, 0xFD, 0xF7, 0xF7, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFD, 0xF7, 0xF7, 0xFF]
 | |
|     - [0x80] |