def test_10__namespaces_from_file(self): ref = { "http://example.com/ns/config": '', "http://example.com/ns/config/val": "val" } xmlfile = anyconfig.compat.StringIO(TBC.read_from_res("20-00-cnf.xml")) self.assertTrue(dicts_equal(TT._namespaces_from_file(xmlfile), ref))
class HasParserTrait(TBC.HasParserTrait): psr = TT.Parser() cnf = CNF_0 cnf_s = to_bytes(TBC.read_from_res("20-10-cnf.xml"))
class HasParserTrait(TBC.HasParserTrait): psr = TT.Parser() cnf = CNF cnf_s = TBC.read_from_res("20-00-cnf.properties")
# # Copyright (C) 2012 - 2018 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=missing-docstring,invalid-name,too-few-public-methods # pylint: disable=ungrouped-imports from __future__ import absolute_import import anyconfig.backend.json.default as TT import tests.backend.common as TBC from anyconfig.compat import OrderedDict CNF_0_S = TBC.read_from_res("20-00-cnf.json") CNF_0 = OrderedDict((("a", 0), ("b", "bbb"), ("c", 5), ("sect0", OrderedDict((("d", ["x", "y", "z"]), ))))) class HasParserTrait(TBC.HasParserTrait): psr = TT.Parser() cnf_s = CNF_0_S cnf = CNF_0 class Test_10(TBC.Test_10_dumps_and_loads, HasParserTrait): load_options = dump_options = dict(parse_int=None, indent=2) empty_patterns = [('', {}), ('{}', {}), ('[]', []), ('null', None)]
# # Copyright (C) 2012 - 2019 Satoru SATOH <satoru.satoh @ gmail.com> # License: MIT # from __future__ import absolute_import import tests.backend.common as TBC from anyconfig.compat import OrderedDict CNF_S = TBC.read_from_res("20-00-cnf.yml") CNF = OrderedDict((("a", 0), ("b", "bbb"), ("c", [1, 2, 3]), ("sect0", OrderedDict((("d", "x y z".split()), ))), ("sect1", OrderedDict((("d", "x y z".split()), ("e", True)))))) # vim:sw=4:ts=4:et:
# # Copyright (C) 2012 - 2019 Satoru SATOH <satoru.satoh @ gmail.com> # License: MIT # from __future__ import absolute_import import tests.backend.common as TBC from anyconfig.compat import OrderedDict CNF_S = TBC.read_from_res("20-00-cnf.yml") CNF = OrderedDict((("a", 0), ("b", "bbb"), ("c", [1, 2, 3]), ("sect0", OrderedDict((("d", "x y z".split()), ))), ("sect1", OrderedDict( (("d", "x y z".split()), ("e", True)))))) # vim:sw=4:ts=4:et:
def test_10__namespaces_from_file(self): ref = {"http://example.com/ns/config": '', "http://example.com/ns/config/val": "val"} xmlfile = anyconfig.compat.StringIO(TBC.read_from_res("20-00-cnf.xml")) self.assertTrue(dicts_equal(TT._namespaces_from_file(xmlfile), ref))
class HasParserTrait(TBC.HasParserTrait): psr = TT.Parser() cnf_s = TBC.read_from_res("20-00-cnf.ini")