mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-07 08:49:37 +08:00
change: getFilenameWithoutExtension
This commit is contained in:
@@ -19,8 +19,7 @@ type HAR struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *HAR) GenJSON() (jsonPath string, err error) {
|
func (h *HAR) GenJSON() (jsonPath string, err error) {
|
||||||
ext := filepath.Ext(h.path)
|
jsonPath = getFilenameWithoutExtension(h.path) + ".json"
|
||||||
jsonPath = h.path[0:len(h.path)-len(ext)] + ".json"
|
|
||||||
|
|
||||||
tCase := h.makeTestCase()
|
tCase := h.makeTestCase()
|
||||||
err = tCase.Dump2JSON(jsonPath)
|
err = tCase.Dump2JSON(jsonPath)
|
||||||
@@ -28,8 +27,7 @@ func (h *HAR) GenJSON() (jsonPath string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *HAR) GenYAML() (yamlPath string, err error) {
|
func (h *HAR) GenYAML() (yamlPath string, err error) {
|
||||||
ext := filepath.Ext(h.path)
|
yamlPath = getFilenameWithoutExtension(h.path) + ".yaml"
|
||||||
yamlPath = h.path[0:len(h.path)-len(ext)] + ".yaml"
|
|
||||||
|
|
||||||
tCase := h.makeTestCase()
|
tCase := h.makeTestCase()
|
||||||
err = tCase.Dump2YAML(yamlPath)
|
err = tCase.Dump2YAML(yamlPath)
|
||||||
@@ -55,3 +53,8 @@ func (h *HAR) prepareTestSteps() []*httpboomer.TStep {
|
|||||||
var steps []*httpboomer.TStep
|
var steps []*httpboomer.TStep
|
||||||
return steps
|
return steps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getFilenameWithoutExtension(path string) string {
|
||||||
|
ext := filepath.Ext(path)
|
||||||
|
return path[0 : len(path)-len(ext)]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user