Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``

related #644 
The printed message would be better as a message in the assert.