aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_custom_parser_with_config_file.py
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2020-08-01 11:53:56 -0500
committerEugene Triguba <eugenetriguba@gmail.com>2020-08-01 11:53:56 -0500
commitb1c23487c33fc2ad5503b6340b17980a326918c8 (patch)
treedb8fa8f1147ddcdd0df072431cfdb37e24976a1c /tests/test_custom_parser_with_config_file.py
parentAdd '-E yaml -E toml' to install instructions (diff)
downloadconfig-file-b1c23487c33fc2ad5503b6340b17980a326918c8.zip
Lint files
Diffstat (limited to 'tests/test_custom_parser_with_config_file.py')
-rw-r--r--tests/test_custom_parser_with_config_file.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test_custom_parser_with_config_file.py b/tests/test_custom_parser_with_config_file.py
new file mode 100644
index 0000000..3c8bf98
--- /dev/null
+++ b/tests/test_custom_parser_with_config_file.py
@@ -0,0 +1,31 @@
+# def test_that_custom_parser_can_be_used(template_and_config_file):
+# class CustomParser(AbstractParser):
+# def __init__(self, file_contents):
+# super().__init__(file_contents)
+#
+# def parse(self, file_contents: str):
+# return file_contents
+#
+# def get(self, key, parse_types=True):
+# return key
+#
+# def set(self, key, value):
+# return key, value
+#
+# def delete(self, section_key):
+# return section_key
+#
+# def has(self, section_key: str) -> bool:
+# return True
+#
+# def stringify(self) -> str:
+# return str(self.parsed_content)
+#
+# template_file, config = template_and_config_file(parser=CustomParser)
+#
+# assert isinstance(config._ConfigFile__parser, CustomParser)
+# assert config.get("key") == "key"
+# assert config.set("key", "value") == ("key", "value")
+# assert config.delete("section_key") == "section_key"
+# assert config.has("blah")
+# assert config.stringify() == template_file.read_text()