Andrew Mcendoo carried out the crime in Wembley, north London, after officers stopped the 39-year-old for a drugs search earlier this month.
During the search Mcendoo, of North Circular Road, Neasden, was also found to be in possession of heroin.
He pleaded guilty to charges and was sentenced at Willesden Magistrates’ Court on Monday to 12 months in prison – for two counts of assault on an emergency worker, and two months for possession of Class A drugs.
The Met labelled Mcendoo’s actions towards its officers “completely unacceptable”.
Police Sergeant Andrew Marsh, of the North West Command Unit, said: “This behaviour is completely unacceptable. Our officers spend every day working to protect their local communities.
“Mcendoo’s actions placed them at risk that day. It is clear that he knew he would be arrested if found in possession of the drugs, so he intentionally coughed at them. However, they were not deterred and a quantity of Class A drugs is now off the streets.”
It is a crime under current coronavirus legislation to deliberately attempt to infect a person with the virus.