fix: unittest

This commit is contained in:
debugtalk
2022-12-26 11:20:32 +08:00
parent 9ff44d0bad
commit 57afeadc26
4 changed files with 66 additions and 18 deletions
+20
View File
@@ -18,6 +18,7 @@ const (
suffixYAML = ".yaml"
suffixGoTest = ".go"
suffixPyTest = ".py"
suffixHAR = ".har"
)
type FromType int
@@ -54,6 +55,25 @@ func (fromType FromType) String() string {
}
}
func (fromType FromType) Extensions() []string {
switch fromType {
case FromTypeYAML:
return []string{suffixYAML, ".yml"}
case FromTypeHAR:
return []string{suffixHAR}
case FromTypePostman, FromTypeSwagger:
return []string{suffixJSON}
case FromTypeCurl:
return []string{".txt", ".curl"}
case FromTypeGotest:
return []string{suffixGoTest}
case FromTypePyest:
return []string{suffixPyTest}
default:
return []string{suffixJSON}
}
}
type OutputType int
const (