Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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