forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimelines_test.go
25 lines (19 loc) · 963 Bytes
/
timelines_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) TestTimelinePathManager() {
// Put the timeline in a notebook
manager := paths.NewSuperTimelinePathManager(
"你好世界/hello",
paths.NewNotebookPathManager("N.123").SuperTimelineDir())
assert.Equal(self.T(), "/ds/notebooks/N.123/timelines/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C%2Fhello.json.db",
self.getDatastorePath(manager.Path()))
// Create a child timeline
child_manager := manager.GetChild("你好世界")
assert.Equal(self.T(), "/fs/notebooks/N.123/timelines/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C%2Fhello/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C.json",
self.getFilestorePath(child_manager.Path()))
assert.Equal(self.T(), "/fs/notebooks/N.123/timelines/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C%2Fhello/%E4%BD%A0%E5%A5%BD%E4%B8%96%E7%95%8C.json.tidx",
self.getFilestorePath(child_manager.Index()))
}