refactored unit tests for filter.py module [ci skip]