Skip to content

Commit

Permalink
#217: Add tests for QueryFilter abstract class
Browse files Browse the repository at this point in the history
- Similar testing principle to testing the abstract backend class
  • Loading branch information
MRichards99 committed Apr 8, 2021
1 parent 20e4b68 commit fb57cee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_query_filter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from datagateway_api.common.filters import QueryFilter


class TestQueryFilter:
def test_abstract_class(self):
"""Test the `QueryFilter` class has all required abstract methods"""

QueryFilter.__abstractmethods__ = set()

class DummyQueryFilter(QueryFilter):
pass

qf = DummyQueryFilter()

apply_filter = "apply_filter"

assert qf.precedence is None
assert qf.apply_filter(apply_filter) is None

0 comments on commit fb57cee

Please sign in to comment.