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