from typing import Callable
import logging


def test_combination_wrapper(
    test_combination: Callable[..., bool]) -> Callable[..., int]:
  """Wraps a test function with post processing functionality.

  In particular, the wrapper invokes test_combination, logs the test and its
  status, and returns a boolean to indicate the status of passing (True) or
  failing (False).

  Args:
    test_combination: A Callable object for invoking the test with one
      combination of the test parameters, and returns a boolean to indicate the
      status of passing (True) or failing (False).

  Returns:
    A wrapper of the given test_combination function.
  """

  def wrapper(*args) -> int:
    passed = test_combination(*args)

    status_str = "passed" if passed else "failed"
    test_name = "_".join([str(i) for i in args])
    logging.info(f"test_{test_name} {status_str}.")

    return passed

  return wrapper