mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			504 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			504 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package models
 | 
						|
 | 
						|
import (
 | 
						|
	_ "github.com/go-sql-driver/mysql"
 | 
						|
	"github.com/iwind/TeaGo/dbs"
 | 
						|
	"testing"
 | 
						|
)
 | 
						|
 | 
						|
func TestNodeDAO_FindAllNodeIdsMatch(t *testing.T) {
 | 
						|
	var tx *dbs.Tx
 | 
						|
	nodeIds, err := SharedNodeDAO.FindAllNodeIdsMatch(tx, 1, 0)
 | 
						|
	if err != nil {
 | 
						|
		t.Fatal(err)
 | 
						|
	}
 | 
						|
	t.Log(nodeIds)
 | 
						|
}
 | 
						|
 | 
						|
func TestNodeDAO_UpdateNodeUp(t *testing.T) {
 | 
						|
	dbs.NotifyReady()
 | 
						|
	var tx *dbs.Tx
 | 
						|
	isChanged, err := SharedNodeDAO.UpdateNodeUp(tx, 57, false, 3, 3)
 | 
						|
	if err != nil {
 | 
						|
		t.Fatal(err)
 | 
						|
	}
 | 
						|
	t.Log("changed:", isChanged)
 | 
						|
}
 |