mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 07:57:21 +08:00
fix: tests
This commit is contained in:
@@ -271,7 +271,7 @@ func (s *VhostTestSuite) TestBasicAuth() {
|
||||
s.NotNil(got)
|
||||
s.Equal(auth["user_file"], got["user_file"])
|
||||
|
||||
err = s.vhost.SetBasicAuth(nil)
|
||||
err = s.vhost.ClearBasicAuth()
|
||||
s.NoError(err)
|
||||
s.Nil(s.vhost.BasicAuth())
|
||||
}
|
||||
@@ -288,7 +288,7 @@ func (s *VhostTestSuite) TestRateLimit() {
|
||||
got := s.vhost.RateLimit()
|
||||
s.NotNil(got)
|
||||
|
||||
err = s.vhost.SetRateLimit(nil)
|
||||
err = s.vhost.ClearRateLimit()
|
||||
s.NoError(err)
|
||||
s.Nil(s.vhost.RateLimit())
|
||||
}
|
||||
|
||||
@@ -500,8 +500,7 @@ func (v *baseVhost) RateLimit() *types.RateLimit {
|
||||
rate = directive.GetParameters()[0].GetValue()
|
||||
}
|
||||
}
|
||||
directives, err := v.parser.Find("server.limit_conn")
|
||||
|
||||
directives, _ := v.parser.Find("server.limit_conn")
|
||||
var limitConn [][]string
|
||||
for _, dir := range directives {
|
||||
limitConn = append(limitConn, v.parser.parameters2Slices(dir.GetParameters()))
|
||||
|
||||
@@ -138,7 +138,7 @@ func (s *VhostTestSuite) TestListenWithHTTP3() {
|
||||
|
||||
got := s.vhost.Listen()
|
||||
s.Len(got, 1)
|
||||
s.Equal("http3", got[0].Args[0])
|
||||
s.Equal("quic", got[0].Args[0])
|
||||
}
|
||||
|
||||
func (s *VhostTestSuite) TestSSL() {
|
||||
@@ -183,7 +183,7 @@ func (s *VhostTestSuite) TestClearSSL() {
|
||||
}
|
||||
|
||||
func (s *VhostTestSuite) TestPHP() {
|
||||
s.Equal(0, s.vhost.PHP())
|
||||
s.Equal(uint(0), s.vhost.PHP())
|
||||
|
||||
s.NoError(s.vhost.SetPHP(84))
|
||||
|
||||
@@ -239,7 +239,7 @@ func (s *VhostTestSuite) TestBasicAuth() {
|
||||
s.NotNil(got)
|
||||
s.Equal(auth["user_file"], got["user_file"])
|
||||
|
||||
s.NoError(s.vhost.SetBasicAuth(nil))
|
||||
s.NoError(s.vhost.ClearBasicAuth())
|
||||
s.Nil(s.vhost.BasicAuth())
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ func (s *VhostTestSuite) TestRateLimit() {
|
||||
s.NotNil(got)
|
||||
s.Equal("512k", got.Rate)
|
||||
|
||||
s.NoError(s.vhost.SetRateLimit(nil))
|
||||
s.NoError(s.vhost.ClearRateLimit())
|
||||
s.Nil(s.vhost.RateLimit())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user