mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-13 00:42:49 -05:00
switch hto monorepo structure
This commit is contained in:
34
backend/internal/server/network/detect_test.go
Normal file
34
backend/internal/server/network/detect_test.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package network
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestBackendType_Constants(t *testing.T) {
|
||||
assert.Equal(t, BackendType(0), BackendNone)
|
||||
assert.Equal(t, BackendType(1), BackendNetworkManager)
|
||||
assert.Equal(t, BackendType(2), BackendIwd)
|
||||
assert.Equal(t, BackendType(3), BackendConnMan)
|
||||
assert.Equal(t, BackendType(4), BackendNetworkd)
|
||||
}
|
||||
|
||||
func TestDetectResult_HasNetworkdField(t *testing.T) {
|
||||
result := &DetectResult{
|
||||
Backend: BackendNetworkd,
|
||||
HasNetworkd: true,
|
||||
HasIwd: true,
|
||||
}
|
||||
|
||||
assert.True(t, result.HasNetworkd)
|
||||
assert.True(t, result.HasIwd)
|
||||
assert.Equal(t, BackendNetworkd, result.Backend)
|
||||
}
|
||||
|
||||
func TestDetectNetworkStack_Integration(t *testing.T) {
|
||||
result, err := DetectNetworkStack()
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
assert.NotEmpty(t, result.ChosenReason)
|
||||
}
|
||||
Reference in New Issue
Block a user