mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-27 19:30:20 +08:00
change: update NewData function
This commit is contained in:
@@ -837,9 +837,9 @@ type DataOptions struct {
|
||||
IgnoreNotFoundError bool // ignore error if target element not found
|
||||
}
|
||||
|
||||
func NewData(options ...DataOption) *DataOptions {
|
||||
func NewData(d map[string]interface{}, options ...DataOption) *DataOptions {
|
||||
data := &DataOptions{
|
||||
Data: map[string]interface{}{},
|
||||
Data: d,
|
||||
}
|
||||
for _, option := range options {
|
||||
option(data)
|
||||
@@ -868,16 +868,6 @@ func NewData(options ...DataOption) *DataOptions {
|
||||
return data
|
||||
}
|
||||
|
||||
func (d *DataOptions) MergeData(data map[string]interface{}) {
|
||||
for key, value := range data {
|
||||
d.Data[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
func (d *DataOptions) AddData(key string, value interface{}) {
|
||||
d.Data[key] = value
|
||||
}
|
||||
|
||||
// current implemeted device: IOSDevice, AndroidDevice
|
||||
type Device interface {
|
||||
UUID() string
|
||||
|
||||
Reference in New Issue
Block a user