mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-22 21:15:35 +03:00
* TestAuth: improve test
This commit is contained in:
parent
2191c49161
commit
44353821e6
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ func TestAuth(t *testing.T) {
|
|||
|
||||
// add session with TTL = 2 sec
|
||||
s = session{}
|
||||
s.expire = uint32(now + 2)
|
||||
s.expire = uint32(time.Now().UTC().Unix() + 2)
|
||||
a.addSession(sess, &s)
|
||||
assert.True(t, a.CheckSession(sessStr) == 0)
|
||||
|
||||
|
@ -59,7 +59,7 @@ func TestAuth(t *testing.T) {
|
|||
// the session is still alive
|
||||
assert.True(t, a.CheckSession(sessStr) == 0)
|
||||
// reset our expiration time because CheckSession() has just updated it
|
||||
s.expire = uint32(now + 2)
|
||||
s.expire = uint32(time.Now().UTC().Unix() + 2)
|
||||
a.storeSession(sess, &s)
|
||||
a.Close()
|
||||
|
||||
|
|
Loading…
Reference in a new issue