patch model&rpc (#207)
* change column to read from information_schema * reactor generate mode from datasource * reactor generate mode from datasource * add primary key check logic * resolve rebase conflicts * add naming style * add filename test case * resolve rebase conflicts * reactor test * add test case * change shell script to makefile * update rpc new * update gen_test.go * format code * format code * update test * generates alias
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package generator
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
@@ -9,13 +8,13 @@ import (
|
||||
)
|
||||
|
||||
func TestProtoTmpl(t *testing.T) {
|
||||
out, err := filepath.Abs("./test/test.proto")
|
||||
_ = Clean()
|
||||
// exists dir
|
||||
err := ProtoTmpl(t.TempDir())
|
||||
assert.Nil(t, err)
|
||||
defer func() {
|
||||
_ = os.RemoveAll(filepath.Dir(out))
|
||||
}()
|
||||
err = ProtoTmpl(out)
|
||||
assert.Nil(t, err)
|
||||
_, err = os.Stat(out)
|
||||
|
||||
// not exist dir
|
||||
dir := filepath.Join(t.TempDir(), "test")
|
||||
err = ProtoTmpl(dir)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user