wings/server/power_test.go

24 lines
446 B
Go
Raw Normal View History

2022-01-23 17:49:35 +00:00
package server
import (
"testing"
. "github.com/franela/goblin"
2022-10-06 15:58:42 +00:00
"github.com/pterodactyl/wings/system"
2022-01-23 17:49:35 +00:00
)
func TestPower(t *testing.T) {
g := Goblin(t)
g.Describe("Server#ExecutingPowerAction", func() {
g.It("should return based on locker status", func() {
s := &Server{powerLock: system.NewLocker()}
2022-01-23 17:49:35 +00:00
g.Assert(s.ExecutingPowerAction()).IsFalse()
s.powerLock.Acquire()
g.Assert(s.ExecutingPowerAction()).IsTrue()
})
})
}