blob: 2d14c1d8589c7382cd5ae558e305dacc715892f6 (
plain)
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
32
|
package fusefrontend_reverse
import (
"github.com/rfjakob/gocryptfs/internal/nametransform"
)
type IgnoreParserMock struct {
toExclude string
calledWith string
}
func (parser *IgnoreParserMock) MatchesPath(f string) bool {
parser.calledWith = f
return f == parser.toExclude
}
type NameTransformMock struct {
nametransform.NameTransform
}
func (n *NameTransformMock) DecryptName(cipherName string, iv []byte) (string, error) {
return "mockdecrypt_" + cipherName, nil
}
func createRFSWithMocks() (*RootNode, *IgnoreParserMock) {
ignorerMock := &IgnoreParserMock{}
nameTransformMock := &NameTransformMock{}
var rfs RootNode
rfs.excluder = ignorerMock
rfs.nameTransform = nameTransformMock
return &rfs, ignorerMock
}
|