Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``

related #644 
Why are you removing these lines?

I suspect it was added for a reason but can't remember and there doesn't seem to be any notes here.