Refactor and add tests for plugins.py

Improvement to the tests currently being run on ``plugins.py``

related #644 
No need to read all lines into a list, instead use `for line in search_file:`