Change time global handling (#29)

* Reverse time

* Change time handling global

* Remove debug functions

* Remove *pgp methods
This commit is contained in:
wussler 2019-10-22 18:44:45 +02:00 committed by GitHub
parent d398098113
commit 136c0a5495
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 154 additions and 138 deletions

21
crypto/time_test.go Normal file
View 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)
}