Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``

related #644 
Is `plugin.config` correct or should it be `plugin.plugin_object.config`?