Skip to content

Commit 56af912

Browse files
author
Nijat Khanbabayev
committed
Try to improve code coverage
Signed-off-by: Nijat Khanbabayev <nijat.khanbabayev@cubistsystematic.com>
1 parent 58b4650 commit 56af912

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ccflow/tests/test_base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,13 @@ class LocalCallable(CallableModel):
205205
def __call__(self, context: NullContext) -> GenericResult:
206206
return GenericResult(value="ok")
207207

208-
register.assert_called_once()
209-
args, kwargs = register.call_args
210-
self.assertIs(args[0], LocalCallable)
208+
result = LocalCallable()(NullContext())
209+
210+
calls_for_local = [(args, kwargs) for args, kwargs in register.call_args_list if args and args[0] is LocalCallable]
211+
self.assertEqual(len(calls_for_local), 1)
212+
_, kwargs = calls_for_local[0]
211213
self.assertEqual(kwargs["kind"], "callable_model")
214+
self.assertEqual(result.value, "ok")
212215

213216
def test_explicit_override_respected(self):
214217
with mock.patch("ccflow.base.register_local_subclass") as register:

0 commit comments

Comments
 (0)