Exemple #1
0
 def test_nil_toxml(self):
     for dt in (
             wsme.types.bytes,
             [int], {int: str}, bool,
             datetime.date, datetime.time, datetime.datetime):
         x = et.tostring(toxml(dt, 'value', None))
         assert x == b('<value nil="true" />'), x
Exemple #2
0
    def test_unset_attrs(self):
        class AType(object):
            someattr = wsme.types.bytes

        wsme.types.register_type(AType)

        x = et.tostring(toxml(AType, 'value', AType()))
        assert x == b('<value />'), x
Exemple #3
0
    def test_unset_attrs(self):
        class AType(object):
            someattr = wsme.types.bytes

        wsme.types.register_type(AType)

        x = et.tostring(toxml(AType, 'value', AType()))
        assert x == b('<value />'), x
Exemple #4
0
 def test_nil_toxml(self):
     for dt in (wsme.types.bytes, [int], {
             int: str
     }, bool, datetime.date, datetime.time, datetime.datetime):
         x = et.tostring(toxml(dt, 'value', None))
         assert x == b('<value nil="true" />'), x