Not much he/she could do to stop it, given that not taking would in effect be an admission of guilt, and probably result in a worse penalty than a failure - OP?
How about going to the manager and saying it was a big mistake on your side and that you'll never do it again and to give you another chance so you don't get demoted. If you pursue this do you not risk losing your job? I imagine the manager's job would also be on the line if you were found with drugs in your system and he did nothing about it particularly as you do say your area is a safety critical job. He may also be making an example of you so other employees do not take drugs. Also how do you know that taking spamspamspam didn't affect your job performance? (DavyJones - what is a mickey D?)
Sure - If I work for an organisation, and know that have a drug testing policy, regardless of whether it is targeted, random, mandatory, required after accident or mistake, whatever...if in those circumstances I choose to smoke spamspamspam (at weekend etc), knowing the consequences of being caught, then when I do get caught, I deserve what I get...
Seriously, when is a person responsible for their own actions?