Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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