def METHOD_NAME(state_name):
    """
    Test - latest_active when the newest kernel is already active
    """
    reboot = MagicMock(return_value=False)
    with patch.dict(kernelpkg.__salt__, {"kernelpkg.needs_reboot": reboot}):
        with patch.dict(kernelpkg.__opts__, {"test": False}):
            kernelpkg.__salt__["system.reboot"].reset_mock()
            ret = kernelpkg.latest_active(name=state_name)
            assert ret["name"] == state_name
            assert ret["result"]
            assert ret["changes"] == {}
            assert isinstance(ret["comment"], str)
            kernelpkg.__salt__["system.reboot"].assert_not_called()
        with patch.dict(kernelpkg.__opts__, {"test": True}):
            kernelpkg.__salt__["system.reboot"].reset_mock()
            ret = kernelpkg.latest_active(name=state_name)
            assert ret["name"] == state_name
            assert ret["result"]
            assert ret["changes"] == {}
            assert isinstance(ret["comment"], str)
            kernelpkg.__salt__["system.reboot"].assert_not_called()