mirror of
https://github.com/gin-gonic/gin.git
synced 2026-04-29 23:23:18 +08:00
modify testifylint error
This commit is contained in:
parent
47de2f52db
commit
2075a1bce5
@ -26,7 +26,7 @@ func TestLoadConfig(t *testing.T) {
|
||||
|
||||
func TestLoadConfigNotFound(t *testing.T) {
|
||||
opt, err := LoadConfig("nonexistent.yaml")
|
||||
assert.Error(t, err)
|
||||
require.Error(t, err)
|
||||
assert.Nil(t, opt)
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ func TestLoadConfigInvalidYAML(t *testing.T) {
|
||||
tmpFile.Close()
|
||||
|
||||
opt, err := LoadConfig(tmpFile.Name())
|
||||
assert.Error(t, err)
|
||||
require.Error(t, err)
|
||||
assert.Nil(t, opt)
|
||||
}
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ func TestLimitedListenerAtLimit(t *testing.T) {
|
||||
client := &http.Client{Timeout: 500 * time.Millisecond}
|
||||
_, err := client.Get(server.URL)
|
||||
// Connection should be rejected
|
||||
assert.Error(t, err, "expected connection to be rejected")
|
||||
require.Error(t, err, "expected connection to be rejected")
|
||||
|
||||
// Release the blocked connections
|
||||
close(block)
|
||||
@ -106,7 +106,7 @@ func TestLimitedConnRelease(t *testing.T) {
|
||||
// Second request should fail
|
||||
client := &http.Client{Timeout: 200 * time.Millisecond}
|
||||
_, err := client.Get(server.URL)
|
||||
assert.Error(t, err, "expected connection to be rejected when limit reached")
|
||||
require.Error(t, err, "expected connection to be rejected when limit reached")
|
||||
|
||||
// Release the first connection
|
||||
close(block)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user