mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
34 lines
1 KiB
Go
34 lines
1 KiB
Go
package status
|
|
|
|
import "testing"
|
|
|
|
func TestStatus(t *testing.T) {
|
|
|
|
setSelectedSecurityLevel(SecurityLevelOff)
|
|
if FmtActiveSecurityLevel() != "Dynamic" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelDynamic)
|
|
AddOrUpdateThreat(&Threat{MitigationLevel: SecurityLevelSecure})
|
|
if FmtActiveSecurityLevel() != "Dynamic*" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelSecure)
|
|
if FmtActiveSecurityLevel() != "Secure" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelSecure)
|
|
AddOrUpdateThreat(&Threat{MitigationLevel: SecurityLevelFortress})
|
|
if FmtActiveSecurityLevel() != "Secure*" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelFortress)
|
|
if FmtActiveSecurityLevel() != "Fortress" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
}
|