mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
lib/model: Add test for previous commit
This commit is contained in:
parent
cd290d2d05
commit
88244b0c1f
@ -3384,3 +3384,16 @@ func TestDevicePause(t *testing.T) {
|
|||||||
t.Fatal("Timed out before device was paused")
|
t.Fatal("Timed out before device was paused")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDeviceWasSeen(t *testing.T) {
|
||||||
|
m, _, fcfg := setupModelWithConnection()
|
||||||
|
defer cleanupModelAndRemoveDir(m, fcfg.Filesystem().URI())
|
||||||
|
|
||||||
|
m.deviceWasSeen(device1)
|
||||||
|
|
||||||
|
stats := m.DeviceStatistics()
|
||||||
|
entry := stats[device1.String()]
|
||||||
|
if time.Since(entry.LastSeen) > time.Second {
|
||||||
|
t.Error("device should have been seen now")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user