refactor: rename test/ to tests/
This commit is contained in:
parent
af2debc19b
commit
f9ed0463f7
6 changed files with 16 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
from datetime import date, datetime, time
|
from datetime import date, datetime, time
|
||||||
|
|
||||||
from streamer.localize.extract_datetime import (
|
from streamd.localize.extract_datetime import (
|
||||||
extract_date_from_marker,
|
extract_date_from_marker,
|
||||||
extract_datetime_from_file_name,
|
extract_datetime_from_file_name,
|
||||||
extract_datetime_from_marker,
|
extract_datetime_from_marker,
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
from faker import Faker
|
from faker import Faker
|
||||||
|
from streamd.parse import Shard, StreamFile, parse_markdown_file
|
||||||
from streamer.parse import Shard, StreamFile, parse_markdown_file
|
|
||||||
|
|
||||||
fake = Faker()
|
fake = Faker()
|
||||||
|
|
||||||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from streamer.localize import LocalizedShard
|
from streamd.localize import LocalizedShard
|
||||||
from streamer.query.find import find_shard, find_shard_by_position
|
from streamd.query.find import find_shard, find_shard_by_position
|
||||||
|
|
||||||
|
|
||||||
def generate_localized_shard(
|
def generate_localized_shard(
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from streamer.localize.localize import localize_stream_file
|
from streamd.localize.localize import localize_stream_file
|
||||||
from streamer.localize.localized_shard import LocalizedShard
|
from streamd.localize.localized_shard import LocalizedShard
|
||||||
from streamer.localize.repository_configuration import (
|
from streamd.localize.repository_configuration import (
|
||||||
Dimension,
|
Dimension,
|
||||||
Marker,
|
Marker,
|
||||||
MarkerPlacement,
|
MarkerPlacement,
|
||||||
RepositoryConfiguration,
|
RepositoryConfiguration,
|
||||||
)
|
)
|
||||||
from streamer.parse.shard import Shard, StreamFile
|
from streamd.parse.shard import Shard, StreamFile
|
||||||
|
|
||||||
repository_configuration = RepositoryConfiguration(
|
repository_configuration = RepositoryConfiguration(
|
||||||
dimensions={
|
dimensions={
|
||||||
|
|
@ -29,8 +29,8 @@ repository_configuration = RepositoryConfiguration(
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
markers={
|
markers={
|
||||||
"Streamer": Marker(
|
"Streamd": Marker(
|
||||||
display_name="Streamer",
|
display_name="Streamd",
|
||||||
placements=[
|
placements=[
|
||||||
MarkerPlacement(dimension="project"),
|
MarkerPlacement(dimension="project"),
|
||||||
MarkerPlacement(
|
MarkerPlacement(
|
||||||
|
|
@ -49,39 +49,39 @@ class TestLocalize:
|
||||||
def test_project_simple_stream_file(self):
|
def test_project_simple_stream_file(self):
|
||||||
stream_file = StreamFile(
|
stream_file = StreamFile(
|
||||||
file_name="20250622-121000 Test File.md",
|
file_name="20250622-121000 Test File.md",
|
||||||
shard=Shard(start_line=1, end_line=1, markers=["Streamer"]),
|
shard=Shard(start_line=1, end_line=1, markers=["Streamd"]),
|
||||||
)
|
)
|
||||||
|
|
||||||
assert localize_stream_file(
|
assert localize_stream_file(
|
||||||
stream_file, repository_configuration
|
stream_file, repository_configuration
|
||||||
) == LocalizedShard(
|
) == LocalizedShard(
|
||||||
moment=datetime(2025, 6, 22, 12, 10, 0, 0),
|
moment=datetime(2025, 6, 22, 12, 10, 0, 0),
|
||||||
markers=["Streamer"],
|
markers=["Streamd"],
|
||||||
tags=[],
|
tags=[],
|
||||||
start_line=1,
|
start_line=1,
|
||||||
end_line=1,
|
end_line=1,
|
||||||
children=[],
|
children=[],
|
||||||
location={"project": "Streamer", "file": stream_file.file_name},
|
location={"project": "Streamd", "file": stream_file.file_name},
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_timesheet_use_case(self):
|
def test_timesheet_use_case(self):
|
||||||
stream_file = StreamFile(
|
stream_file = StreamFile(
|
||||||
file_name="20260131-210000 Test File.md",
|
file_name="20260131-210000 Test File.md",
|
||||||
shard=Shard(start_line=1, end_line=1, markers=["Timesheet", "Streamer"]),
|
shard=Shard(start_line=1, end_line=1, markers=["Timesheet", "Streamd"]),
|
||||||
)
|
)
|
||||||
|
|
||||||
assert localize_stream_file(
|
assert localize_stream_file(
|
||||||
stream_file, repository_configuration
|
stream_file, repository_configuration
|
||||||
) == LocalizedShard(
|
) == LocalizedShard(
|
||||||
moment=datetime(2026, 1, 31, 21, 0, 0, 0),
|
moment=datetime(2026, 1, 31, 21, 0, 0, 0),
|
||||||
markers=["Timesheet", "Streamer"],
|
markers=["Timesheet", "Streamd"],
|
||||||
tags=[],
|
tags=[],
|
||||||
start_line=1,
|
start_line=1,
|
||||||
end_line=1,
|
end_line=1,
|
||||||
children=[],
|
children=[],
|
||||||
location={
|
location={
|
||||||
"file": stream_file.file_name,
|
"file": stream_file.file_name,
|
||||||
"project": "Streamer",
|
"project": "Streamd",
|
||||||
"timesheet": "coding",
|
"timesheet": "coding",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue