forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers_test.go
25 lines (18 loc) · 948 Bytes
/
users_test.go
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
package paths_test
import (
"github.com/alecthomas/assert"
"www.velocidex.com/golang/velociraptor/paths"
)
func (self *PathManagerTestSuite) TestUserPathManager() {
manager := paths.NewUserPathManager("你好世界")
assert.Equal(self.T(), "/ds/users/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C.db",
self.getDatastorePath(manager.Path()))
assert.Equal(self.T(), "/ds/acl/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C.json.db",
self.getDatastorePath(manager.ACL()))
assert.Equal(self.T(), "/ds/users/gui/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C.json.db",
self.getDatastorePath(manager.GUIOptions()))
assert.Equal(self.T(), "/ds/users/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C/mru/C.1234.db",
self.getDatastorePath(manager.MRUClient("C.1234")))
assert.Equal(self.T(), "/ds/users/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C/Favorites/CLIENT/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C.json.db",
self.getDatastorePath(manager.Favorites("你好世界", "CLIENT")))
}