I agree with Stove, God does not punish a believer.
So that leaves you with 3 things. God's discipline, God's testing, and satan's temptation.
satan's temptation is the 'easiest' to understand. If your being tempted to do something that is sinful, you can guarantee its not of God.
God's discipline is a little harder to understand, but it is known by the fact His discipline is to bring us back in line with His ways. It is often known by Him putting up 'road block' in our path, which direct us back to His. His discipline normally does not 'feel' good, but it always points us to God - it will never point us away from Him.
God's testing is probably the hardest to understand. Job is a perfect example of this. Sometimes we get confused by it, thinking God is testing us for His benefit or knowledge. When we think of testing in that regard, we miss the truth of the matter. God does not need to test us in order to see for Himself what we will do - He already knows what we will do, and He knows we are weak and made of dust.
God's testing is always done to show us our own intentions and desires. Its a purifying of our hearts. What it does is show us what our motives are, what our thoughts are toward, what we are doing things for. When He tests us, we know it because we always come to a point of making a decision - to follow Him, or to not. The testing in that regards is often when we feel 'alone'. It is Him saying, "I have brought you here, now you make a choice which way you will go".
We are not alone, but we often feel like it because He is wanting to show us our own direction. You can think of it just like any other 'test'. Tests are always given to show the person taking the test just what they know. I would say that God never tests us on something we have no clue about, but rather the tests come from something He has already taught us.
I think that God's discipline always follows His testing.