Should we put God to test? No –


  Luke 4:12 ... Do not put the Lord your God to the test.


Yes – 


  Judges 6:39 “Allow me one more test with the fleece, but this time
  make the fleece dry and let the ground be covered with dew.”


No - 


  Matthew 12:39 A wicked and adulterous generation asks for a miraculous
  sign!


Yes - 


  2 Kings 20:8 Meanwhile, Hezekiah had said to Isaiah, "What sign will
  the LORD give to prove that he will heal me and that I will go to the
  Temple of the LORD three days from now?"


No – 


  Deuteronomy 6:16  You shall not test the LORD your God, as you tested
  him in Massah.


Yes – 


  Genesis 15:8  But Abram said, "O Sovereign LORD, how can I know that I
  will gain possession of it?
The answer is simple and these fragments all support it:

No - we shouldn't test God. We shouldn't demand revelations, we shouldn't demand signs and miracles, as it is stated in the fragments you are citing.

Yes - we should test revelations. As Saint John the Teologian states:


  Beloved, believe not every spirit, but try the spirits whether they are of God (1 John, 4, 1)


All these people you see in Bible "testing God" received some revelation, but were not sure if it is from God, or if they are in some kind of delusion. They don't doubt there is God. They doubt if the revelation is genuine. That's why they put it to the test.