Test invalid url in getWatchOptionsFromReq() (#1850)
This commit is contained in:
committed by
GitHub
parent
f02461097b
commit
50bc755b44
2
.github/workflows/jobs.yaml
vendored
2
.github/workflows/jobs.yaml
vendored
@@ -1142,7 +1142,7 @@ jobs:
|
||||
result=${result%\%}
|
||||
echo "result:"
|
||||
echo $result
|
||||
threshold=35.60
|
||||
threshold=35.9
|
||||
if (( $(echo "$result >= $threshold" |bc -l) )); then
|
||||
echo "It is equal or greater than threshold, passed!"
|
||||
else
|
||||
|
||||
@@ -289,4 +289,12 @@ func TestWatch(t *testing.T) {
|
||||
assert.Equal(expectedOptions.Suffix, opts.Suffix)
|
||||
assert.Equal(expectedOptions.Events, opts.Events)
|
||||
}
|
||||
|
||||
// Test-9: getWatchOptionsFromReq invalid url
|
||||
u, err = url.Parse("http://localhost/api/v1/wach/bucket2?prefix=&suffix=")
|
||||
req = &http.Request{
|
||||
URL: u,
|
||||
}
|
||||
opts, err = getWatchOptionsFromReq(req)
|
||||
assert.Error(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user