-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: single loader ignored path components
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import io | ||
from pathlib import Path | ||
|
||
from dissect.target import Target | ||
from dissect.target.filesystem import VirtualFilesystem | ||
from dissect.target.loaders.single import SingleFileLoader | ||
|
||
|
||
def test_single_loader(target_default: Target) -> None: | ||
path = Path("test/single.txt") | ||
vfs = VirtualFilesystem() | ||
vfs.map_file_fh("test/single.txt", io.BytesIO(b"\x00")) | ||
log_loader = SingleFileLoader(vfs.path(path)) | ||
log_loader.map(target_default) | ||
|
||
assert target_default.fs.exists("$drop$/test/single.txt") |