Change time global handling (#29)
* Reverse time * Change time handling global * Remove debug functions * Remove *pgp methods
This commit is contained in:
parent
d398098113
commit
136c0a5495
23 changed files with 154 additions and 138 deletions
21
crypto/time_test.go
Normal file
21
crypto/time_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package crypto
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestTime(t *testing.T) {
|
||||
UpdateTime(1571072494)
|
||||
time.Sleep(1 * time.Second)
|
||||
diff, err := getDiff()
|
||||
|
||||
if err != nil {
|
||||
t.Fatal("Expected no error when calculating time difference, got:", err)
|
||||
}
|
||||
assert.Exactly(t, int64(1), diff)
|
||||
|
||||
UpdateTime(testTime)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue