package mod

import (
	"../nt"
	"fmt"
	"os"
	"testing"
)

func setup() {
	err := nt.InstInit("test", "1.0", "conf.json")
	if nil != err {
		fmt.Println("init failed.")
		return
	}
	LoadScripts()

}

func TestMod(t *testing.T) {
	r, err := nt.Rdb.Exists("user:168001").Result()
	t.Log(r, err)
}

func TestLua(t *testing.T) {
	//SaveUserAgent(173203, 1010101)
	RemoveUserAgent(173203, 1010101)
}

func teardown() {

}

func TestMain(m *testing.M) {
	setup()
	code := m.Run()
	teardown()
	fmt.Println("init")
	os.Exit(code)
}
