Git: mock time functions in tests.

This commit is contained in:
Abiola Ibrahim
2015-05-28 08:21:10 +01:00
parent 879558b9ee
commit 2013838bfd
7 changed files with 87 additions and 16 deletions

View File

@ -34,7 +34,7 @@ func Test(t *testing.T) {
}
}
time.Sleep(time.Second * 5)
gos.Sleep(time.Second * 5)
Services.Stop(repos[0].URL, 1)
if len(Services.services) != 4 {
t.Errorf("Expected %v service(s), found %v", 4, len(Services.services))
@ -52,7 +52,7 @@ func Test(t *testing.T) {
t.Errorf("Expected %v service(s), found %v", 6, len(Services.services))
}
time.Sleep(time.Second * 5)
gos.Sleep(time.Second * 5)
Services.Stop(repo.URL, -1)
if len(Services.services) != 4 {
t.Errorf("Expected %v service(s), found %v", 4, len(Services.services))