mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19: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() != "Normal" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelNormal)
|
|
AddOrUpdateThreat(&Threat{MitigationLevel: SecurityLevelHigh})
|
|
if FmtActiveSecurityLevel() != "Normal*" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelHigh)
|
|
if FmtActiveSecurityLevel() != "High" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelHigh)
|
|
AddOrUpdateThreat(&Threat{MitigationLevel: SecurityLevelExtreme})
|
|
if FmtActiveSecurityLevel() != "High*" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
setSelectedSecurityLevel(SecurityLevelExtreme)
|
|
if FmtActiveSecurityLevel() != "Extreme" {
|
|
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
|
|
}
|
|
|
|
}
|