Skip to content

Commit 50bc755

Browse files
authored
Test invalid url in getWatchOptionsFromReq() (#1850)
1 parent f024610 commit 50bc755

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/jobs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ jobs:
11421142
result=${result%\%}
11431143
echo "result:"
11441144
echo $result
1145-
threshold=35.60
1145+
threshold=35.9
11461146
if (( $(echo "$result >= $threshold" |bc -l) )); then
11471147
echo "It is equal or greater than threshold, passed!"
11481148
else

restapi/user_watch_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,4 +289,12 @@ func TestWatch(t *testing.T) {
289289
assert.Equal(expectedOptions.Suffix, opts.Suffix)
290290
assert.Equal(expectedOptions.Events, opts.Events)
291291
}
292+
293+
// Test-9: getWatchOptionsFromReq invalid url
294+
u, err = url.Parse("http://localhost/api/v1/wach/bucket2?prefix=&suffix=")
295+
req = &http.Request{
296+
URL: u,
297+
}
298+
opts, err = getWatchOptionsFromReq(req)
299+
assert.Error(err)
292300
}

0 commit comments

Comments
 (0)