refactor: NewConfig

This commit is contained in:
debugtalk
2021-12-08 13:07:39 +08:00
parent 9689201d29
commit a55f523fd7
10 changed files with 67 additions and 44 deletions

View File

@@ -12,7 +12,7 @@ import (
func (tc *TestCase) ToTCase() (*TCase, error) {
tCase := TCase{
Config: tc.Config,
Config: tc.Config.ToStruct(),
}
for _, step := range tc.TestSteps {
tCase.TestSteps = append(tCase.TestSteps, step.ToStruct())
@@ -105,7 +105,7 @@ func loadFromYAML(path string) (*TCase, error) {
func (tc *TCase) ToTestCase() (*TestCase, error) {
testCase := &TestCase{
Config: tc.Config,
Config: &Config{cfg: tc.Config},
}
for _, step := range tc.TestSteps {
if step.Request != nil {