-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathtesthelpers_windows_test.go
More file actions
31 lines (26 loc) · 1.34 KB
/
testhelpers_windows_test.go
File metadata and controls
31 lines (26 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Mondoo, Inc.
// SPDX-License-Identifier: BUSL-1.1
//go:build windows
package windows
import (
"github.com/spf13/afero"
"go.mondoo.com/mql/v13/providers-sdk/v1/inventory"
"go.mondoo.com/mql/v13/providers/os/connection/shared"
)
// mockLocalConnection implements shared.Connection and returns Type_Local.
// It is used by multiple test files in this package.
type mockLocalConnection struct{}
func (m *mockLocalConnection) ID() uint32 { return 0 }
func (m *mockLocalConnection) ParentID() uint32 { return 0 }
func (m *mockLocalConnection) RunCommand(command string) (*shared.Command, error) { return nil, nil }
func (m *mockLocalConnection) FileInfo(path string) (shared.FileInfoDetails, error) {
return shared.FileInfoDetails{}, nil
}
func (m *mockLocalConnection) FileSystem() afero.Fs { return afero.NewOsFs() }
func (m *mockLocalConnection) Name() string { return "mock-local" }
func (m *mockLocalConnection) Type() shared.ConnectionType { return shared.Type_Local }
func (m *mockLocalConnection) Asset() *inventory.Asset { return &inventory.Asset{} }
func (m *mockLocalConnection) UpdateAsset(asset *inventory.Asset) {}
func (m *mockLocalConnection) Capabilities() shared.Capabilities {
return shared.Capability_None
}