From 69c15b5740a109050c8eb6023fcc2b40c4757715 Mon Sep 17 00:00:00 2001 From: Satoru SATOH Date: Sat, 31 Dec 2016 12:14:55 +0900 Subject: [PATCH] fix: add missing XML test cases in .tests.api --- anyconfig/tests/api.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/anyconfig/tests/api.py b/anyconfig/tests/api.py index 6e5bcc3f..809674a8 100644 --- a/anyconfig/tests/api.py +++ b/anyconfig/tests/api.py @@ -54,6 +54,12 @@ d: {{ b.d }} """ +CNF_XML_1 = { + 'config': {'@attrs': {'name': 'foo'}, + '@children': [{'a': {'@text': '0'}}, + {'b': {'@attrs': {'id': 'b0'}, + '@text': 'bbb'}}]}} + def _is_file_object(obj): try: @@ -290,7 +296,7 @@ def test_19_dump_and_single_load_with_validation(self): class Test_32_single_load(unittest.TestCase): - cnf = dict(a=dict(b=1, c=dict(d=[1, 2], e="eee"))) + cnf = CNF_XML_1 def setUp(self): self.workdir = anyconfig.tests.common.setup_workdir() @@ -315,7 +321,11 @@ def _wopen_ropen_file(self, filename, rmode='r', wmode='w'): def test_10_open_json_file(self): self._wopen_ropen_file("a.json") - def test_20_open_bson_file(self): + def test_20_open_xml_file(self): + if "bson" in anyconfig.backends.list_types(): + self._wopen_ropen_file("a.xml", 'rb', 'wb') + + def test_30_open_bson_file(self): if "bson" in anyconfig.backends.list_types(): self._wopen_ropen_file("a.bson", 'rb', 'wb')