mirror of
https://github.com/Ascend/ascend-docker-runtime.git
synced 2025-10-25 21:10:20 +08:00
Match-id-a3b458b461f8ce21fd2d8e39d327aaadcd606687
This commit is contained in:
29
runtime/main_test.go
Normal file
29
runtime/main_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user