mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	
		
			
	
	
		
			18 lines
		
	
	
		
			261 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			261 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								package models
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import (
							 | 
						||
| 
								 | 
							
									_ "github.com/go-sql-driver/mysql"
							 | 
						||
| 
								 | 
							
									"testing"
							 | 
						||
| 
								 | 
							
								)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								func TestSysEvent_DecodeEvent(t *testing.T) {
							 | 
						||
| 
								 | 
							
									event := &SysEvent{
							 | 
						||
| 
								 | 
							
										Type: "serverChange",
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									eventObj, err := event.DecodeEvent()
							 | 
						||
| 
								 | 
							
									if err != nil {
							 | 
						||
| 
								 | 
							
										t.Fatal(err)
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									t.Log(eventObj)
							 | 
						||
| 
								 | 
							
								}
							 |