Would Jesus have stayed off the mountain if Lepers were there? No.He was a brave man and a loyal man to God.
Can't question his loyalty to God, but his actions were foolish and he ended up dead behind them.
What did Jesus do when when tempted by the devil?
"Again it is written, 'You shall not put the Lord, your God, to the test.'" (Matthew 4:7) quoting Deuteronomy 6:16.[44]