diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-26 17:07:15 -0600 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2020-01-26 17:07:15 -0600 |
| commit | 09058bfcbaf07b7c45a8c9d5745bd60d54ce6353 (patch) | |
| tree | 6fd1040521a96af952bf2648a9433529a80563be | |
| parent | Remove running codecov twice in CI (diff) | |
| download | config-file-09058bfcbaf07b7c45a8c9d5745bd60d54ce6353.zip | |
Test base parse function
| -rw-r--r-- | poetry.lock | 6 | ||||
| -rw-r--r-- | tests/test_base_parser.py | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/poetry.lock b/poetry.lock index 64dd310..17c2ec5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -169,7 +169,7 @@ description = "File identification library for Python" name = "identify" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" -version = "1.4.10" +version = "1.4.11" [package.extras] license = ["editdistance"] @@ -483,8 +483,8 @@ gprof2dot = [ {file = "gprof2dot-2019.11.30.tar.gz", hash = "sha256:b43fe04ebb3dfe181a612bbfc69e90555b8957022ad6a466f0308ed9c7f22e99"}, ] identify = [ - {file = "identify-1.4.10-py2.py3-none-any.whl", hash = "sha256:418f3b2313ac0b531139311a6b426854e9cbdfcfb6175447a5039aa6291d8b30"}, - {file = "identify-1.4.10.tar.gz", hash = "sha256:8ad99ed1f3a965612dcb881435bf58abcfbeb05e230bb8c352b51e8eac103360"}, + {file = "identify-1.4.11-py2.py3-none-any.whl", hash = "sha256:1222b648251bdcb8deb240b294f450fbf704c7984e08baa92507e4ea10b436d5"}, + {file = "identify-1.4.11.tar.gz", hash = "sha256:d824ebe21f38325c771c41b08a95a761db1982f1fc0eee37c6c97df3f1636b96"}, ] isort = [ {file = "isort-4.3.21-py2.py3-none-any.whl", hash = "sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"}, 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) |