Commit feb2bc2b9e7ea82949099100f5ba78d450b441cb

Authored by yangfan
1 parent 191c2cc9

商家服务单接口测试用例

@@ -14,6 +14,208 @@ def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath): @@ -14,6 +14,208 @@ def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
14 } 14 }
15 ) 15 )
16 return m 16 return m
17 - 17 +def get_data_noname(phone,map_address,longPoint,latPoint,filePath,imagePath):
  18 + m = MultipartEncoder(
  19 + fields={
  20 + 'phone': phone,
  21 + 'map_address': map_address,
  22 + 'long': longPoint,
  23 + 'lat': latPoint,
  24 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  25 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  26 + }
  27 + )
  28 + return m
  29 +def get_data_nophone(name,map_address,longPoint,latPoint,filePath,imagePath):
  30 + m = MultipartEncoder(
  31 + fields={
  32 + 'name': name,
  33 + 'map_address': map_address,
  34 + 'long': longPoint,
  35 + 'lat': latPoint,
  36 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  37 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  38 + }
  39 + )
  40 + return m
  41 +def get_data_nomapaddress(name,phone,longPoint,latPoint,filePath,imagePath):
  42 + m = MultipartEncoder(
  43 + fields={
  44 + 'name': name,
  45 + 'phone': phone,
  46 + 'long': longPoint,
  47 + 'lat': latPoint,
  48 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  49 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  50 + }
  51 + )
  52 + return m
  53 +def get_data_nofile(name,phone,map_address,longPoint,latPoint,imagePath):
  54 + m = MultipartEncoder(
  55 + fields={
  56 + 'name': name,
  57 + 'phone': phone,
  58 + 'map_address': map_address,
  59 + 'long': longPoint,
  60 + 'lat': latPoint,
  61 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  62 + }
  63 + )
  64 + return m
  65 +def get_data_noimage(name,phone,map_address,longPoint,latPoint,filePath):
  66 + m = MultipartEncoder(
  67 + fields={
  68 + 'name': name,
  69 + 'phone': phone,
  70 + 'map_address': map_address,
  71 + 'long': longPoint,
  72 + 'lat': latPoint,
  73 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg')
  74 + }
  75 + )
  76 + return m
  77 +def get_data_nolong(name,phone,map_address,latPoint,filePath,imagePath):
  78 + m = MultipartEncoder(
  79 + fields={
  80 + 'name': name,
  81 + 'phone': phone,
  82 + 'map_address': map_address,
  83 + 'lat': latPoint,
  84 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  85 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  86 + }
  87 + )
  88 + return m
  89 +def get_data_nolat(name,phone,map_address,longPoint,filePath,imagePath):
  90 + m = MultipartEncoder(
  91 + fields={
  92 + 'name': name,
  93 + 'phone': phone,
  94 + 'map_address': map_address,
  95 + 'long': longPoint,
  96 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  97 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  98 + }
  99 + )
  100 + return m
18 def get_content_type(data): 101 def get_content_type(data):
19 return data.content_type 102 return data.content_type
  103 +
  104 +def set_data(sellerid,name,phone,map_address,longPoint,latPoint,filePath,imagePath):
  105 + m = MultipartEncoder(
  106 + fields={
  107 + 'id': sellerid,
  108 + 'name': name,
  109 + 'phone': phone,
  110 + 'map_address': map_address,
  111 + 'long': longPoint,
  112 + 'lat': latPoint,
  113 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  114 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  115 + }
  116 + )
  117 + return m
  118 +def set_data_noid(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
  119 + m = MultipartEncoder(
  120 + fields={
  121 + 'name': name,
  122 + 'phone': phone,
  123 + 'map_address': map_address,
  124 + 'long': longPoint,
  125 + 'lat': latPoint,
  126 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  127 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  128 + }
  129 + )
  130 + return m
  131 +def set_data_noname(sellerid,phone,map_address,longPoint,latPoint,filePath,imagePath):
  132 + m = MultipartEncoder(
  133 + fields={
  134 + 'id': sellerid,
  135 + 'phone': phone,
  136 + 'map_address': map_address,
  137 + 'long': longPoint,
  138 + 'lat': latPoint,
  139 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  140 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  141 + }
  142 + )
  143 + return m
  144 +def set_data_nophone(sellerid,name,map_address,longPoint,latPoint,filePath,imagePath):
  145 + m = MultipartEncoder(
  146 + fields={
  147 + 'id': sellerid,
  148 + 'name': name,
  149 + 'map_address': map_address,
  150 + 'long': longPoint,
  151 + 'lat': latPoint,
  152 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  153 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  154 + }
  155 + )
  156 + return m
  157 +def set_data_nomapaddress(sellerid,name,phone,longPoint,latPoint,filePath,imagePath):
  158 + m = MultipartEncoder(
  159 + fields={
  160 + 'id': sellerid,
  161 + 'name': name,
  162 + 'phone': phone,
  163 + 'long': longPoint,
  164 + 'lat': latPoint,
  165 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  166 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  167 + }
  168 + )
  169 + return m
  170 +def set_data_nolong(sellerid,name,phone,map_address,latPoint,filePath,imagePath):
  171 + m = MultipartEncoder(
  172 + fields={
  173 + 'id': sellerid,
  174 + 'name': name,
  175 + 'phone': phone,
  176 + 'map_address': map_address,
  177 + 'lat': latPoint,
  178 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  179 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  180 + }
  181 + )
  182 + return m
  183 +def set_data_nolat(sellerid,name,phone,map_address,longPoint,filePath,imagePath):
  184 + m = MultipartEncoder(
  185 + fields={
  186 + 'id': sellerid,
  187 + 'name': name,
  188 + 'phone': phone,
  189 + 'map_address': map_address,
  190 + 'long': longPoint,
  191 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
  192 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  193 + }
  194 + )
  195 + return m
  196 +def set_data_nofile(sellerid,name,phone,map_address,longPoint,latPoint,imagePath):
  197 + m = MultipartEncoder(
  198 + fields={
  199 + 'id': sellerid,
  200 + 'name': name,
  201 + 'phone': phone,
  202 + 'map_address': map_address,
  203 + 'long': longPoint,
  204 + 'lat': latPoint,
  205 + 'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
  206 + }
  207 + )
  208 + return m
  209 +def set_data_noimage(sellerid,name,phone,map_address,longPoint,latPoint,filePath):
  210 + m = MultipartEncoder(
  211 + fields={
  212 + 'id': sellerid,
  213 + 'name': name,
  214 + 'phone': phone,
  215 + 'map_address': map_address,
  216 + 'long': longPoint,
  217 + 'lat': latPoint,
  218 + 'file': ('file', open(filePath, 'rb'), 'image/jpeg')
  219 + }
  220 + )
  221 + return m
@@ -4,10 +4,10 @@ @@ -4,10 +4,10 @@
4 base_url: http://dc1.colorcun.com:10005?s= 4 base_url: http://dc1.colorcun.com:10005?s=
5 5
6 - test: 6 - test:
7 - name: 添加商家信息 7 + name: 添加商家信息(正确操作)
8 variable_binds: 8 variable_binds:
9 - - name: "测试店"  
10 - - phone: "18044499" 9 + - name: "呷哺1"
  10 + - phone: "18011111111"
11 - map_address: "陕西省西安市" 11 - map_address: "陕西省西安市"
12 - long: "123" 12 - long: "123"
13 - lat: "456" 13 - lat: "456"
@@ -22,17 +22,209 @@ @@ -22,17 +22,209 @@
22 data: $multipart_encoder 22 data: $multipart_encoder
23 validate: 23 validate:
24 - eq: ["content.ret", 200] 24 - eq: ["content.ret", 200]
  25 +
25 - test: 26 - test:
26 - name: 获取商家列表数据 27 + name: 添加商家信息(不填name)
  28 + variable_binds:
  29 + - phone: "18011111111"
  30 + - map_address: "陕西省西安市"
  31 + - long: "123"
  32 + - lat: "456"
  33 + - file: "/Users/orange/cover.jpeg"
  34 + - image: "/Users/orange/cover.jpeg"
  35 + - multipart_encoder: ${get_data_noname($phone,$map_address,$long,$lat,$file,$image)}
  36 + request:
  37 + url: App.Seller.AddSeller
  38 + method: POST
  39 + headers:
  40 + Content-Type: ${get_content_type($multipart_encoder)}
  41 + data: $multipart_encoder
  42 + validate:
  43 + - eq: ["content.ret", 400]
  44 + - eq: ["content.msg","非法请求:缺少必要参数name"]
  45 +
  46 +- test:
  47 + name: 添加商家信息(不填phone)
  48 + variable_binds:
  49 + - name: "呷哺1"
  50 + - map_address: "陕西省西安市"
  51 + - long: "123"
  52 + - lat: "456"
  53 + - file: "/Users/orange/cover.jpeg"
  54 + - image: "/Users/orange/cover.jpeg"
  55 + - multipart_encoder: ${get_data_nophone($name,$map_address,$long,$lat,$file,$image)}
  56 + request:
  57 + url: App.Seller.AddSeller
  58 + method: POST
  59 + headers:
  60 + Content-Type: ${get_content_type($multipart_encoder)}
  61 + data: $multipart_encoder
  62 + validate:
  63 + - eq: ["content.ret", 400]
  64 + - eq: ["content.msg","非法请求:缺少必要参数phone"]
  65 +- test:
  66 + name: 添加商家信息(不填map_address)
  67 + variable_binds:
  68 + - name: "呷哺1"
  69 + - phone: "18011111111"
  70 + - map_address: "陕西省西安市"
  71 + - long: "123"
  72 + - lat: "456"
  73 + - file: "/Users/orange/cover.jpeg"
  74 + - image: "/Users/orange/cover.jpeg"
  75 + - multipart_encoder: ${get_data_nomapaddress($name,$phone,$long,$lat,$file,$image)}
  76 + request:
  77 + url: App.Seller.AddSeller
  78 + method: POST
  79 + headers:
  80 + Content-Type: ${get_content_type($multipart_encoder)}
  81 + data: $multipart_encoder
  82 + validate:
  83 + - eq: ["content.ret", 400]
  84 + - eq: ["content.msg","非法请求:缺少必要参数map_address"]
  85 +- test:
  86 + name: 添加商家信息(不填file)
  87 + variable_binds:
  88 + - name: "呷哺1"
  89 + - phone: "18011111111"
  90 + - map_address: "陕西省西安市"
  91 + - long: "123"
  92 + - lat: "456"
  93 + - image: "/Users/orange/cover.jpeg"
  94 + - multipart_encoder: ${get_data_nofile($name,$phone,$map_address,$long,$lat,$image)}
  95 + request:
  96 + url: App.Seller.AddSeller
  97 + method: POST
  98 + headers:
  99 + Content-Type: ${get_content_type($multipart_encoder)}
  100 + data: $multipart_encoder
  101 + validate:
  102 + - eq: ["content.ret", 400]
  103 + - eq: ["content.msg","非法请求:缺少上传文件:file"]
  104 +- test:
  105 + name: 添加商家信息(不填image)
  106 + variable_binds:
  107 + - name: "呷哺1"
  108 + - phone: "18011111111"
  109 + - map_address: "陕西省西安市"
  110 + - long: "123"
  111 + - lat: "456"
  112 + - file: "/Users/orange/cover.jpeg"
  113 + - multipart_encoder: ${get_data_noimage($name,$phone,$map_address,$long,$lat,$file)}
  114 + request:
  115 + url: App.Seller.AddSeller
  116 + method: POST
  117 + headers:
  118 + Content-Type: ${get_content_type($multipart_encoder)}
  119 + data: $multipart_encoder
  120 + validate:
  121 + - eq: ["content.ret", 400]
  122 + - eq: ["content.msg","非法请求:缺少上传文件:image"]
  123 +- test:
  124 + name: 添加商家信息(不填long)
  125 + variable_binds:
  126 + - name: "呷哺1"
  127 + - phone: "18011111111"
  128 + - map_address: "陕西省西安市"
  129 + - lat: "456"
  130 + - file: "/Users/orange/cover.jpeg"
  131 + - image: "/Users/orange/cover.jpeg"
  132 + - multipart_encoder: ${get_data_nolong($name,$phone,$map_address,$lat,$file,$image)}
  133 + request:
  134 + url: App.Seller.AddSeller
  135 + method: POST
  136 + headers:
  137 + Content-Type: ${get_content_type($multipart_encoder)}
  138 + data: $multipart_encoder
  139 + validate:
  140 + - eq: ["content.ret", 400]
  141 + - eq: ["content.msg","非法请求:缺少必要参数long"]
  142 +- test:
  143 + name: 添加商家信息(不填lat)
  144 + variable_binds:
  145 + - name: "呷哺1"
  146 + - phone: "18011111111"
  147 + - map_address: "陕西省西安市"
  148 + - long: "123"
  149 + - file: "/Users/orange/cover.jpeg"
  150 + - image: "/Users/orange/cover.jpeg"
  151 + - multipart_encoder: ${get_data_nolat($name,$phone,$map_address,$long,$file,$image)}
  152 + request:
  153 + url: App.Seller.AddSeller
  154 + method: POST
  155 + headers:
  156 + Content-Type: ${get_content_type($multipart_encoder)}
  157 + data: $multipart_encoder
  158 + validate:
  159 + - eq: ["content.ret", 400]
  160 + - eq: ["content.msg","非法请求:缺少必要参数lat"]
  161 +- test:
  162 + name: 添加商家信息(重复name)
  163 + variable_binds:
  164 + - name: "呷哺1"
  165 + - phone: "18011111112"
  166 + - map_address: "陕西省西安市"
  167 + - long: "123"
  168 + - lat: "456"
  169 + - file: "/Users/orange/cover.jpeg"
  170 + - image: "/Users/orange/cover.jpeg"
  171 + - multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)}
  172 + request:
  173 + url: App.Seller.AddSeller
  174 + method: POST
  175 + headers:
  176 + Content-Type: ${get_content_type($multipart_encoder)}
  177 + data: $multipart_encoder
  178 + validate:
  179 + - eq: ["content.ret", 399]
  180 + - eq: ["content.msg","非法请求:名称已存在"]
  181 +- test:
  182 + name: 添加商家信息(重复phone)
  183 + variable_binds:
  184 + - name: "呷哺2"
  185 + - phone: "18011111111"
  186 + - map_address: "陕西省西安市"
  187 + - long: "123"
  188 + - lat: "456"
  189 + - file: "/Users/orange/cover.jpeg"
  190 + - image: "/Users/orange/cover.jpeg"
  191 + - multipart_encoder: ${get_data($name,$phone,$map_address,$long,$lat,$file,$image)}
  192 + request:
  193 + url: App.Seller.AddSeller
  194 + method: POST
  195 + headers:
  196 + Content-Type: ${get_content_type($multipart_encoder)}
  197 + data: $multipart_encoder
  198 + validate:
  199 + - eq: ["content.ret", 398]
  200 + - eq: ["content.msg","非法请求:手机号已存在"]
  201 +
  202 +
  203 +
  204 +
  205 +- test:
  206 + name: 获取商家列表数据(查询第一页)
27 request: 207 request:
28 url: App.Seller.SellerLists 208 url: App.Seller.SellerLists
29 method: POST 209 method: POST
30 data: 210 data:
31 - page: "PhalApi" 211 + page: 1
32 validate: 212 validate:
33 - eq: ["content.ret", 200] 213 - eq: ["content.ret", 200]
34 - test: 214 - test:
35 - name: 根据商家ID获取商家信息 215 + name: 获取商家列表数据(查询不存在的页码)
  216 + request:
  217 + url: App.Seller.SellerLists
  218 + method: POST
  219 + data:
  220 + page: 300
  221 + validate:
  222 + - eq: ["content.ret", 396]
  223 + - eq: ["content.msg","非法请求:暂无商家"]
  224 +
  225 +
  226 +- test:
  227 + name: 根据商家ID获取商家信息(sellerid=5)
36 request: 228 request:
37 url: App.Seller.GetSellerById 229 url: App.Seller.GetSellerById
38 method: POST 230 method: POST
@@ -40,10 +232,260 @@ @@ -40,10 +232,260 @@
40 sellerid: 5 232 sellerid: 5
41 validate: 233 validate:
42 - eq: ["content.ret", 200] 234 - eq: ["content.ret", 200]
  235 + - eq: ["content.data.data.id", "5"]
43 - test: 236 - test:
44 - name: 根据商家ID修改商家信息 237 + name: 根据商家ID获取商家信息(sellerid不存在)
45 request: 238 request:
46 url: App.Seller.GetSellerById 239 url: App.Seller.GetSellerById
47 method: POST 240 method: POST
  241 + data:
  242 + sellerid: 10000
  243 + validate:
  244 + - eq: ["content.ret", 396]
  245 + - eq: ["content.msg","非法请求:暂无商家"]
  246 +
  247 +
  248 +
  249 +- test:
  250 + name: 根据商家ID修改商家信息(正确操作)
  251 + variable_binds:
  252 + - id: "15"
  253 + - name: "呷哺修改1"
  254 + - phone: "18022222222"
  255 + - map_address: "陕西省西安市"
  256 + - long: "123"
  257 + - lat: "456"
  258 + - file: "/Users/orange/cover.jpeg"
  259 + - image: "/Users/orange/cover.jpeg"
  260 + - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
  261 + request:
  262 + url: App.Seller.SetSellerById
  263 + method: POST
  264 + headers:
  265 + Content-Type: ${get_content_type($multipart_encoder)}
  266 + data: $multipart_encoder
48 validate: 267 validate:
49 - eq: ["content.ret", 200] 268 - eq: ["content.ret", 200]
  269 +- test:
  270 + name: 根据商家ID修改商家信息(不填id)
  271 + variable_binds:
  272 + - name: "呷哺修改1"
  273 + - phone: "18022222222"
  274 + - map_address: "陕西省西安市"
  275 + - long: "123"
  276 + - lat: "456"
  277 + - file: "/Users/orange/cover.jpeg"
  278 + - image: "/Users/orange/cover.jpeg"
  279 + - multipart_encoder: ${set_data_noid($name,$phone,$map_address,$long,$lat,$file,$image)}
  280 + request:
  281 + url: App.Seller.SetSellerById
  282 + method: POST
  283 + headers:
  284 + Content-Type: ${get_content_type($multipart_encoder)}
  285 + data: $multipart_encoder
  286 + validate:
  287 + - eq: ["content.ret", 400]
  288 + - eq: ["content.msg", "非法请求:缺少必要参数id"]
  289 +- test:
  290 + name: 根据商家ID修改商家信息(不填name)
  291 + variable_binds:
  292 + - id: "15"
  293 + - phone: "18022222221"
  294 + - map_address: "陕西省西安市"
  295 + - long: "123"
  296 + - lat: "456"
  297 + - file: "/Users/orange/cover.jpeg"
  298 + - image: "/Users/orange/cover.jpeg"
  299 + - multipart_encoder: ${set_data_noname($id,$phone,$map_address,$long,$lat,$file,$image)}
  300 + request:
  301 + url: App.Seller.SetSellerById
  302 + method: POST
  303 + headers:
  304 + Content-Type: ${get_content_type($multipart_encoder)}
  305 + data: $multipart_encoder
  306 + validate:
  307 + - eq: ["content.ret", 400]
  308 + - eq: ["content.msg", "非法请求:缺少必要参数name"]
  309 +- test:
  310 + name: 根据商家ID修改商家信息(不填phone)
  311 + variable_binds:
  312 + - id: "15"
  313 + - name: "呷哺修改2"
  314 + - map_address: "陕西省西安市"
  315 + - long: "123"
  316 + - lat: "456"
  317 + - file: "/Users/orange/cover.jpeg"
  318 + - image: "/Users/orange/cover.jpeg"
  319 + - multipart_encoder: ${set_data_nophone($id,$name,$map_address,$long,$lat,$file,$image)}
  320 + request:
  321 + url: App.Seller.SetSellerById
  322 + method: POST
  323 + headers:
  324 + Content-Type: ${get_content_type($multipart_encoder)}
  325 + data: $multipart_encoder
  326 + validate:
  327 + - eq: ["content.ret", 400]
  328 + - eq: ["content.msg", "非法请求:缺少必要参数phone"]
  329 +- test:
  330 + name: 根据商家ID修改商家信息(不填map_address)
  331 + variable_binds:
  332 + - id: "15"
  333 + - name: "呷哺修改2"
  334 + - phone: "18022222221"
  335 + - long: "123"
  336 + - lat: "456"
  337 + - file: "/Users/orange/cover.jpeg"
  338 + - image: "/Users/orange/cover.jpeg"
  339 + - multipart_encoder: ${set_data_nomapaddress($id,$name,$phone,$long,$lat,$file,$image)}
  340 + request:
  341 + url: App.Seller.SetSellerById
  342 + method: POST
  343 + headers:
  344 + Content-Type: ${get_content_type($multipart_encoder)}
  345 + data: $multipart_encoder
  346 + validate:
  347 + - eq: ["content.ret", 400]
  348 + - eq: ["content.msg", "非法请求:缺少必要参数map_address"]
  349 +- test:
  350 + name: 根据商家ID修改商家信息(不填long)
  351 + variable_binds:
  352 + - id: "15"
  353 + - name: "呷哺修改2"
  354 + - phone: "18022222221"
  355 + - map_address: "陕西省西安市"
  356 + - lat: "456"
  357 + - file: "/Users/orange/cover.jpeg"
  358 + - image: "/Users/orange/cover.jpeg"
  359 + - multipart_encoder: ${set_data_nolong($id,$name,$phone,$map_address,$lat,$file,$image)}
  360 + request:
  361 + url: App.Seller.SetSellerById
  362 + method: POST
  363 + headers:
  364 + Content-Type: ${get_content_type($multipart_encoder)}
  365 + data: $multipart_encoder
  366 + validate:
  367 + - eq: ["content.ret", 400]
  368 + - eq: ["content.msg", "非法请求:缺少必要参数long"]
  369 +- test:
  370 + name: 根据商家ID修改商家信息(不填lat)
  371 + variable_binds:
  372 + - id: "15"
  373 + - name: "呷哺修改2"
  374 + - phone: "18022222221"
  375 + - map_address: "陕西省西安市"
  376 + - long: "123"
  377 + - file: "/Users/orange/cover.jpeg"
  378 + - image: "/Users/orange/cover.jpeg"
  379 + - multipart_encoder: ${set_data_nolat($id,$name,$phone,$map_address,$long,$file,$image)}
  380 + request:
  381 + url: App.Seller.SetSellerById
  382 + method: POST
  383 + headers:
  384 + Content-Type: ${get_content_type($multipart_encoder)}
  385 + data: $multipart_encoder
  386 + validate:
  387 + - eq: ["content.ret", 400]
  388 + - eq: ["content.msg", "非法请求:缺少必要参数lat"]
  389 +- test:
  390 + name: 根据商家ID修改商家信息(不填file)
  391 + variable_binds:
  392 + - id: "15"
  393 + - name: "呷哺修改2"
  394 + - phone: "18022222221"
  395 + - map_address: "陕西省西安市"
  396 + - long: "123"
  397 + - lat: "456"
  398 + - image: "/Users/orange/cover.jpeg"
  399 + - multipart_encoder: ${set_data_nofile($id,$name,$phone,$map_address,$long,$lat,$image)}
  400 + request:
  401 + url: App.Seller.SetSellerById
  402 + method: POST
  403 + headers:
  404 + Content-Type: ${get_content_type($multipart_encoder)}
  405 + data: $multipart_encoder
  406 + validate:
  407 + - eq: ["content.ret", 400]
  408 + - eq: ["content.msg", "非法请求:缺少上传文件:file"]
  409 +- test:
  410 + name: 根据商家ID修改商家信息(不填image)
  411 + variable_binds:
  412 + - id: "15"
  413 + - name: "呷哺修改2"
  414 + - phone: "18022222221"
  415 + - map_address: "陕西省西安市"
  416 + - long: "123"
  417 + - lat: "456"
  418 + - file: "/Users/orange/cover.jpeg"
  419 + - multipart_encoder: ${set_data_noimage($id,$name,$phone,$map_address,$long,$lat,$file)}
  420 + request:
  421 + url: App.Seller.SetSellerById
  422 + method: POST
  423 + headers:
  424 + Content-Type: ${get_content_type($multipart_encoder)}
  425 + data: $multipart_encoder
  426 + validate:
  427 + - eq: ["content.ret", 400]
  428 + - eq: ["content.msg", "非法请求:缺少上传文件:image"]
  429 +- test:
  430 + name: 根据商家ID修改商家信息(重复name)
  431 + variable_binds:
  432 + - id: "15"
  433 + - name: "呷哺修改1"
  434 + - phone: "18022222221"
  435 + - map_address: "陕西省西安市"
  436 + - long: "123"
  437 + - lat: "456"
  438 + - file: "/Users/orange/cover.jpeg"
  439 + - image: "/Users/orange/cover.jpeg"
  440 + - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
  441 + request:
  442 + url: App.Seller.AddSeller
  443 + method: POST
  444 + headers:
  445 + Content-Type: ${get_content_type($multipart_encoder)}
  446 + data: $multipart_encoder
  447 + validate:
  448 + - eq: ["content.ret", 399]
  449 + - eq: ["content.msg","非法请求:名称已存在"]
  450 +- test:
  451 + name: 根据商家ID修改商家信息(重复phone)
  452 + variable_binds:
  453 + - id: "15"
  454 + - name: "呷哺修改2"
  455 + - phone: "18022222222"
  456 + - map_address: "陕西省西安市"
  457 + - long: "123"
  458 + - lat: "456"
  459 + - file: "/Users/orange/cover.jpeg"
  460 + - image: "/Users/orange/cover.jpeg"
  461 + - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
  462 + request:
  463 + url: App.Seller.AddSeller
  464 + method: POST
  465 + headers:
  466 + Content-Type: ${get_content_type($multipart_encoder)}
  467 + data: $multipart_encoder
  468 + validate:
  469 + - eq: ["content.ret", 398]
  470 + - eq: ["content.msg","非法请求:手机号已存在"]
  471 +- test:
  472 + name: 根据商家ID修改商家信息(不存在的商家)
  473 + variable_binds:
  474 + - id: "500000"
  475 + - name: "测试店修改"
  476 + - phone: "1804342484"
  477 + - map_address: "陕西省西安市"
  478 + - long: "123"
  479 + - lat: "456"
  480 + - file: "/Users/orange/cover.jpeg"
  481 + - image: "/Users/orange/cover.jpeg"
  482 + - multipart_encoder: ${set_data($id,$name,$phone,$map_address,$long,$lat,$file,$image)}
  483 + request:
  484 + url: App.Seller.SetSellerById
  485 + method: POST
  486 + headers:
  487 + Content-Type: ${get_content_type($multipart_encoder)}
  488 + data: $multipart_encoder
  489 + validate:
  490 + - eq: ["content.ret", 397]
  491 + - eq: ["content.msg","非法请求:修改失败"]