Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(5)  |  Derive(0)  |  Import(2)

src/e/r/erp5-HEAD/product/ERP5SyncML/SyncMLMessage.py   erp5(Download)
from lxml import etree
 
from Products.ERP5SyncML.XMLSyncUtils import resolveSyncmlStatusCode, \
     encode, resolveSyncmlAlertCode
from Products.ERP5SyncML.SyncMLConstant import SYNCML_NAMESPACE, NSMAP
        # base64 formating of "userid:password"
        credential = "%s:%s" % (user_id, password)
        credential = encode(authentication_format, credential)
      elif authentication_type == "syncml:auth-md5":
        # base64 coded md5 for user "XXX", password "XXX", nonce "XXX"

src/e/r/erp5-HEAD/product/ERP5SyncML/tests/testERP5SyncML.py   erp5(Download)
from Products.ERP5Type.tests.runUnitTest import tests_home
from Products.ERP5SyncML.Conduit.ERP5Conduit import ERP5Conduit
from Products.ERP5SyncML.XMLSyncUtils import encode, decode,\
     isDecodeEncodeTheSame
from Products.ERP5SyncML.XMLSyncUtils import getConduitByName
 
    # test with the ERP5 functions
    string_encoded = encode('b64', python)
    self.assertEqual(string_encoded, awaited_result_python)
    string_decoded = decode('b64', awaited_result_python)
                    string_decoded, 'b64'))
 
    string_encoded = encode('b64', long_string)
    self.assertEqual(string_encoded, awaited_result_long_string)
    string_decoded = decode('b64', awaited_result_long_string)
                    string_decoded, 'b64'))
 
    self.assertEqual(encode('b64', ''), '')
    self.assertEqual(decode('b64', ''), '')
    self.assertTrue(isDecodeEncodeTheSame(
                    encode('b64', ''), '', 'b64'))