def METHOD_NAME(
        mocker, desc, swap_cmd_out, swap_cmt_ret_code, kstat_out,
        kstat_ret_code, expected):
    mocker.patch("core.node.sunos.justcall",
                 side_effect=[[swap_cmd_out, "", swap_cmt_ret_code],
                              [kstat_out, "", kstat_ret_code]])
    result = Node().stats_meminfo()
    assert result == expected, (
            "scenario: %s \n"
            "unexpected result: \n"
            "expected %s \n"
            "got      %s \n"
            "swap -l is \n%s\n\n"
            "kstat -n system_pages -p is \n%s"
            % (desc, expected, result, swap_cmd_out, kstat_out)
    )