No, the pharisees didn't think they were actually keeping the commandments. Christ called them hypocrites, the synagogue of satan, and vipers. They were making a show of piety for the masses, only. They were in it for the power and money, and were children of the devil.
How can you actually think you're keeping the commandments when at the same time seeking to kill Jesus? They were frauds, liars, thieves and murderers.