Do they take a blood or urine sample when testing for pneumonia?

Maybe. The complete blood cell count can sometimes help a doc narrow down the potential cause of a pneumonia and a blood culture can find the germ if it is in the blood. Urine is not much of a help but often taken to verify normal kidney function. Many docs know its pneumonia from the exam and or chest x-ray and may treat on that basis.
In some cases. Blood urine cultures, white cell counts are foten helpful but not often specific.