In the state of CA, all cops agree to be tested at any time, any place.
Judges are another matter.
I'll try to be more specific, why are not LEOs and judges RANDOMLY, and ROUTINELY drug tested like in many other professions?
Law Enforcement Officers ARE subjected to routine drug testing. We sign on that as a condition of employment. So again to answer your question, you can sniff our shi-att anytime. :)