Beispiel #1
0
    def test_log_repr_dict_keys_full(self):
        from spyne.model import AnyDict
        from spyne.util.web import log_repr

        t = AnyDict(logged='keys-full')

        assert log_repr({1: 1, 2: 2, 3: 3}, t) == "{1: (...), 2: (...), 3: (...)}"
        assert log_repr([1, 2, 3], t) == "[1, 2, 3]"
Beispiel #2
0
    def test_log_repr_dict_values_full(self):
        from spyne.model import AnyDict
        from spyne.util.web import log_repr

        t = AnyDict(logged='values-full')

        assert log_repr({1: 1, 2: 2, 3: 3}, t) == "{(...): 1, (...): 2, (...): 3}"
        assert log_repr([1, 2, 3], t) == "[1, 2, 3]"
Beispiel #3
0
    def test_log_repr_dict_values(self):
        from spyne.model import AnyDict
        from spyne.util.web import log_repr

        t = AnyDict(logged='values')

        assert log_repr({1: 1}, t) == "{(...): 1}"

        assert log_repr([1], t) == "[1]"
Beispiel #4
0
 def test_anydict_customization(self):
     from spyne.model import json
     assert isinstance(AnyDict.customize(store_as='json').Attributes.store_as, json)
Beispiel #5
0
 def test_anydict_customization(self):
     from spyne.model import json
     assert isinstance(
         AnyDict.customize(store_as='json').Attributes.store_as, json)