Skip to content

Commit

Permalink
test: confirm to include task ID in repr and str
Browse files Browse the repository at this point in the history
  • Loading branch information
mamo3gr committed Jan 9, 2025
1 parent 393c708 commit 522d44e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_task_on_kart.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,10 @@ def test_repr(self):
task_param=_DummySubTaskWithPrivateParameter(),
list_task_param=[_DummySubTaskWithPrivateParameter(), _DummySubTaskWithPrivateParameter()],
)
task_id = task.make_unique_id()
sub_task_id = _DummySubTaskWithPrivateParameter().make_unique_id()
expected = (
f'{__name__}._DummyTaskWithPrivateParameter(int_param=1, private_int_param=1, task_param={__name__}._DummySubTaskWithPrivateParameter({sub_task_id}), '
f'{__name__}._DummyTaskWithPrivateParameter[{task_id}](int_param=1, private_int_param=1, task_param={__name__}._DummySubTaskWithPrivateParameter({sub_task_id}), '
f'list_task_param=[{__name__}._DummySubTaskWithPrivateParameter({sub_task_id}), {__name__}._DummySubTaskWithPrivateParameter({sub_task_id})])'
) # noqa:E501
self.assertEqual(expected, repr(task))
Expand All @@ -564,9 +565,10 @@ def test_str(self):
task_param=_DummySubTaskWithPrivateParameter(),
list_task_param=[_DummySubTaskWithPrivateParameter(), _DummySubTaskWithPrivateParameter()],
)
task_id = task.make_unique_id()
sub_task_id = _DummySubTaskWithPrivateParameter().make_unique_id()
expected = (
f'{__name__}._DummyTaskWithPrivateParameter(int_param=1, task_param={__name__}._DummySubTaskWithPrivateParameter({sub_task_id}), '
f'{__name__}._DummyTaskWithPrivateParameter[{task_id}](int_param=1, task_param={__name__}._DummySubTaskWithPrivateParameter({sub_task_id}), '
f'list_task_param=[{__name__}._DummySubTaskWithPrivateParameter({sub_task_id}), {__name__}._DummySubTaskWithPrivateParameter({sub_task_id})])'
)
self.assertEqual(expected, str(task))
Expand Down

0 comments on commit 522d44e

Please sign in to comment.