ProcessQuestionPic中处理京东返回不正常图片地址的问题
This commit is contained in:
@@ -259,3 +259,29 @@ func TestCheckSelfPickCode(t *testing.T) {
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestProcessQuestionPic(t *testing.T) {
|
||||
for _, v := range [][]string{
|
||||
[]string{
|
||||
"http://img10.360buyimg.com/o2o/jfs/a.jpg",
|
||||
",,,jfs/a.jpg",
|
||||
},
|
||||
[]string{
|
||||
"http://img10.360buyimg.com/o2o/jfs/a.jpg,https://img10.360buyimg.com/o2o/jfs/b.jpg",
|
||||
" , ,, jfs/a.jpg,https:jfs/b.jpg",
|
||||
},
|
||||
[]string{
|
||||
"https://img10.360buyimg.com/o2o/jfs/a.jpg",
|
||||
",https:jfs/a.jpg",
|
||||
},
|
||||
[]string{
|
||||
"",
|
||||
",https:",
|
||||
},
|
||||
} {
|
||||
str := ProcessQuestionPic(v[1])
|
||||
if str != v[0] {
|
||||
t.Fatalf("%s, desired:%s, but its:%s", v[1], v[0], str)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user