Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``

related #644 
Does it really?

The plugin manager cannot enable or disable plugins without overriding this builtin function?