Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``
sorry, what exactly is the issue?