Skip to content

Commit

Permalink
fix: add missing XML test cases in .tests.api
Browse files Browse the repository at this point in the history
  • Loading branch information
ssato committed Dec 31, 2016
1 parent e191418 commit 69c15b5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions anyconfig/tests/api.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand All @@ -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')

Expand Down

0 comments on commit 69c15b5

Please sign in to comment.