refactor: store file in position, rename filename to file_name

Signed-off-by: Konstantin Fickel <mail@konstantinfickel.de>
This commit is contained in:
Konstantin Fickel 2026-01-31 17:21:55 +01:00
parent d5b1541436
commit 79095bad4a
Signed by: kfickel
GPG key ID: A793722F9933C1A5
8 changed files with 27 additions and 24 deletions

View file

@ -16,12 +16,12 @@ class TestAttachMarkdown:
def test_attach_markdown_with_shard(self):
markdown_text = "Hello World\n\nThis is a test."
shard = Shard(start_line=1, end_line=3)
stream_file = StreamFile(filename=self.file_name, shard=shard)
stream_file = StreamFile(file_name=self.file_name, shard=shard)
result = attach_markdown(stream_file, markdown_text)
assert result == StreamFileWithMarkdown(
filename=self.file_name,
file_name=self.file_name,
shard=ShardWithMarkdown(
start_line=1,
end_line=3,
@ -33,11 +33,11 @@ class TestAttachMarkdown:
)
def test_attach_markdown_without_shard(self):
stream_file = StreamFile(filename=self.file_name, shard=None)
stream_file = StreamFile(file_name=self.file_name, shard=None)
result = attach_markdown(stream_file, "Some markdown text")
assert result == StreamFileWithMarkdown(filename=self.file_name, shard=None)
assert result == StreamFileWithMarkdown(file_name=self.file_name, shard=None)
def test_attach_markdown_with_nested_shards(self):
markdown_text = "Header\n\n@Marker1 Content 1\n\n@Marker2 Content 2"
@ -49,11 +49,11 @@ class TestAttachMarkdown:
Shard(markers=["Marker2"], start_line=5, end_line=5),
],
)
stream_file = StreamFile(filename=self.file_name, shard=shard)
stream_file = StreamFile(file_name=self.file_name, shard=shard)
result = attach_markdown(stream_file, markdown_text)
assert result.filename == self.file_name
assert result.file_name == self.file_name
assert result.shard is not None
assert result.shard.start_line == 1
assert result.shard.end_line == 5