From 09058bfcbaf07b7c45a8c9d5745bd60d54ce6353 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sun, 26 Jan 2020 17:07:15 -0600 Subject: Test base parse function --- tests/test_base_parser.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/test_base_parser.py') diff --git a/tests/test_base_parser.py b/tests/test_base_parser.py index 3cd6e8a..64be16e 100644 --- a/tests/test_base_parser.py +++ b/tests/test_base_parser.py @@ -22,7 +22,10 @@ class ConcreteParser(BaseParser): def stringify(self) -> str: super().stringify() - def parse(self, file_contents: str): + def parse(self, file_contents: str, call_super=False): + if call_super: + super().parse(file_contents) + return file_contents @@ -39,6 +42,7 @@ def test_that_base_parser_can_not_be_instantiated(): (ConcreteParser("").delete, ""), (ConcreteParser("").stringify, None), (ConcreteParser("").has, ""), + (ConcreteParser("").parse, "call super"), ], ) def test_that_base_parser_raises_not_implemented_errors(function, args): @@ -47,5 +51,7 @@ def test_that_base_parser_raises_not_implemented_errors(function, args): function() elif type(args) is tuple: function(*args) + elif args == "call super": + function(args, call_super=True) else: function(args) -- cgit v1.2.3