Match-id-a3b458b461f8ce21fd2d8e39d327aaadcd606687

This commit is contained in:
BianTanggui
2020-05-28 15:35:53 +08:00
parent 2eae91a9c5
commit 17dac41280
23 changed files with 1016 additions and 3 deletions

29
runtime/main_test.go Normal file
View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
* Description: Runtime DT测试
*/
package main
import (
"os"
"testing"
"github.com/prashantv/gostub"
)
func TestArgsIsCreate(t *testing.T) {
t.Log("进入测试用例")
testArgs := []string{"create", "--bundle", "."}
stub := gostub.Stub(&os.Args, testArgs)
defer stub.Reset()
stub.Stub(&execRunc, func() error {
t.Log("execute stub")
return nil
})
if err := doProcess(); err != nil {
t.Fatalf("%v", err)
}
}