MCPcopy
hub / github.com/httprunner/httprunner / TestLoadParametersError

Function TestLoadParametersError

hrp/parameters_test.go:89–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestLoadParametersError(t *testing.T) {
90 testData := []struct {
91 configParameters map[string]interface{}
92 }{
93 {
94 map[string]interface{}{
95 "username_password": fmt.Sprintf("${parameterize(%s/account.csv)}", hrpExamplesDir),
96 "user_agent": []interface{}{"iOS/10.1", "iOS/10.2"},
97 },
98 },
99 {
100 map[string]interface{}{
101 "username-password": fmt.Sprintf("${parameterize(%s/account.csv)}", hrpExamplesDir),
102 "user-agent": []interface{}{"iOS/10.1", "iOS/10.2"},
103 },
104 },
105 {
106 map[string]interface{}{
107 "username-password": fmt.Sprintf("${param(%s/account.csv)}", hrpExamplesDir),
108 "user_agent": []interface{}{"iOS/10.1", "iOS/10.2"},
109 },
110 },
111 }
112 parser := newParser()
113 for _, data := range testData {
114 _, err := parser.loadParameters(data.configParameters, map[string]interface{}{})
115 if !assert.Error(t, err) {
116 t.Fatal()
117 }
118 }
119}
120
121func TestInitParametersIteratorCount(t *testing.T) {
122 configParameters := map[string]interface{}{

Callers

nothing calls this directly

Calls 2

newParserFunction · 0.85
loadParametersMethod · 0.80

Tested by

no test coverage detected