feat: add initial support for positioning
Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
parent
28dc40ebf0
commit
0c61067db0
9 changed files with 186 additions and 3 deletions
46
test/test_localize.py
Normal file
46
test/test_localize.py
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
from streamer.localize.localize import localize_stream_file
|
||||
from streamer.localize.localized_shard import LocalizedShard
|
||||
from streamer.localize.repostory_configuration import (
|
||||
Dimension,
|
||||
Marker,
|
||||
RepositoryConfiguration,
|
||||
)
|
||||
from streamer.parse.shard import Shard, StreamFile
|
||||
|
||||
repository_configuration = RepositoryConfiguration(
|
||||
dimensions={
|
||||
"project": Dimension(
|
||||
display_name="Project",
|
||||
comment="GTD Project that is being worked on",
|
||||
propagate=True,
|
||||
),
|
||||
"moment": Dimension(
|
||||
display_name="Moment",
|
||||
comment="Timestamp this entry was created at",
|
||||
propagate=True,
|
||||
),
|
||||
},
|
||||
markers={
|
||||
"streamer": Marker(display_name="Streamer", dimension="project"),
|
||||
"jobhunting": Marker(display_name="JobHunting", dimension="project"),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
class TestExtractDateTime:
|
||||
def test_project_simple_stream_file(self):
|
||||
stream_file = StreamFile(
|
||||
filename="20250622-121000 Test File.md",
|
||||
shard=Shard(start_line=1, end_line=1, markers=["Streamer"]),
|
||||
)
|
||||
|
||||
assert localize_stream_file(
|
||||
stream_file, repository_configuration
|
||||
) == LocalizedShard(
|
||||
markers=["Streamer"],
|
||||
tags=[],
|
||||
start_line=1,
|
||||
end_line=1,
|
||||
children=[],
|
||||
location={"moment": "2025-06-22T12:10:00", "project": "streamer"},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue