Exemple #1
0
def Soapify(value):
    if hasattr(value, 'xsitype'):
        return (value.xsitype, str(value))
    elif isinstance(value, bool):
        return ('xsd:boolean', cwmpbool.format(value))
    elif isinstance(value, int):
        return ('xsd:unsignedInt', str(value))
    elif isinstance(value, float):
        return ('xsd:double', str(value))
    elif isinstance(value, datetime.datetime):
        return ('xsd:dateTime', cwmpdate.format(value))
    else:
        return ('xsd:string', str(value))
Exemple #2
0
def Soapify(value):
  if hasattr(value, 'xsitype'):
    return (value.xsitype, str(value))
  elif isinstance(value, bool):
    return ('xsd:boolean', cwmpbool.format(value))
  elif isinstance(value, int):
    return ('xsd:unsignedInt', str(value))
  elif isinstance(value, float):
    return ('xsd:double', str(value))
  elif isinstance(value, datetime.datetime):
    return ('xsd:dateTime', cwmpdate.format(value))
  else:
    return ('xsd:string', str(value))
Exemple #3
0
 def testFormat(self):
     self.assertEqual(cwmpbool.format(True), '1')
     self.assertEqual(cwmpbool.format(False), '0')
Exemple #4
0
 def testFormat(self):
   self.assertEqual(cwmpbool.format(True), '1')
   self.assertEqual(cwmpbool.format(False), '0')