MCPcopy
hub / github.com/httprunner/httprunner / TestLocateFile

Function TestLocateFile

hrp/plugin_test.go:9–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestLocateFile(t *testing.T) {
10 // specify target file path
11 _, err := locateFile(tmpl("plugin/debugtalk.go"), PluginGoSourceFile)
12 if !assert.Nil(t, err) {
13 t.Fatal()
14 }
15
16 // specify path with the same dir
17 _, err = locateFile(tmpl("plugin/debugtalk.py"), PluginGoSourceFile)
18 if !assert.Nil(t, err) {
19 t.Fatal()
20 }
21
22 // specify target file path dir
23 _, err = locateFile(tmpl("plugin/"), PluginGoSourceFile)
24 if !assert.Nil(t, err) {
25 t.Fatal()
26 }
27
28 // specify wrong path
29 _, err = locateFile(".", PluginGoSourceFile)
30 if !assert.Error(t, err) {
31 t.Fatal()
32 }
33 _, err = locateFile("/abc", PluginGoSourceFile)
34 if !assert.Error(t, err) {
35 t.Fatal()
36 }
37}
38
39func TestLocatePythonPlugin(t *testing.T) {
40 _, err := locatePlugin(tmpl("plugin/debugtalk.py"))

Callers

nothing calls this directly

Calls 2

locateFileFunction · 0.85
tmplFunction · 0.85

Tested by

no test coverage detected