コード例 #1
0
def test():
    from etl_test import etl_test
    import etl
    xmlrpc_conn = etl.connector.xmlrpc_connector('localhost', 8050)
    test1 = etl_test.etl_component_test(xmlrpc_out(xmlrpc_conn))
    server = xmlrpc_conn.connect()
    server.import_data([])
コード例 #2
0
def test():
    from etl_test import etl_test
    import etl
    inp_data = etl.component.input.data([{
        'id': 1,
        'name': 'Fabien',
        'country_id': 3
    }, {
        'id': 2,
        'name': 'Luc',
        'country_id': 3
    }, {
        'id': 3,
        'name': 'Henry',
        'country_id': 1
    }])
    test = etl_test.etl_component_test(inp_data)
    test.check_output([{
        'country_id': 3,
        'id': 1,
        'name': 'Fabien'
    }, {
        'country_id': 3,
        'id': 2,
        'name': 'Luc'
    }, {
        'country_id': 1,
        'id': 3,
        'name': 'Henry'
    }])
    res = test.output()
    print res
コード例 #3
0
ファイル: join.py プロジェクト: dxyuniesky/openerp-extra-6.1
def test():
    from etl_test import etl_test
    import etl
    input_part = [{
        'id': 1,
        'name': 'Fabien',
        'country_id': 3
    }, {
        'id': 2,
        'name': 'Luc',
        'country_id': 3
    }, {
        'id': 3,
        'name': 'Henry',
        'country_id': 1
    }]
    input_cty = [{'id': 1, 'name': 'Belgium'}, {'id': 3, 'name': 'France'}]
    map_keys = {
        'main': {
            'id': "main['id']",
            'name': "main['id'].upper()",
            'country': "country[main['country_id']]['name']"
        }
    }
    join_keys = {'country': 'id'}
    test = etl_test.etl_component_test(join(map_keys, join_keys))
    test.check_input({'partner': input_part, 'countries': input_cty})
    print test.output()
コード例 #4
0
def test():
    from etl_test import etl_test
    import etl
    xmlrpc_conn = etl.connector.xmlrpc_connector('localhost', 8050)
    test1 = etl_test.etl_component_test(xmlrpc_out(xmlrpc_conn))
    server = xmlrpc_conn.connect()
    server.import_data([])
コード例 #5
0
def test():

    from etl_test import etl_test
    import etl
    input_part = [
    {'id': 1, 'name': 'Fabien', 'country_id': 3},
    {'id': 2, 'name': 'Luc', 'country_id': 3},
    {'id': 3, 'name': 'Henry', 'country_id': 1}
    ]
    input_cty = [{'id': 1, 'name': 'Belgium'}, {'id': 3, 'name': 'France'}]
    map_keys = {'main': {
    'id': "main['id']",
    'name': "main['id'].upper()",
    'country': "country_var[main['country_id']]['name']"
    }}
#    def preprocess(self, channels):
#        cdict = {}
#    for trans in channels['country']:
#        for iterator in trans:
#            for d in iterator:
#                cdict[d['id']] = d
#    return {'country_var': cdict}
    test = etl_test.etl_component_test(map(map_keys, None))
    test.check_input({'partner':input_part, 'countries': input_cty})
    test.check_output({'partner':input_part, 'countries': input_cty})
    print test.output()
コード例 #6
0
def test():
    from etl_test import etl_test
    import etl

    openobject_partner = openobject_connector(
        "http://localhost:8070", "trunk", "admin", "a", obj="object", con_type="socket"
    )
    test = etl_test.etl_component_test(
        etl.component.input.openobject_in(
            openobject_partner,
            "res.partner.address",
            fields=[
                "partner_id",
                "title",
                "name",
                "street",
                "street2",
                "phone",
                "city",
                "zip",
                "state_id",
                "country_id",
                "mobile",
                "birthdate",
            ],
        )
    )
    res = test.output()
    print res
コード例 #7
0
def test():
    from etl_test import etl_test
    import etl
    xmlrpc_conn=etl.connector.xmlrpc_connector('localhost', 8050)
    conn = xmlrpc_conn.start('import_data')
    test1 = etl_test.etl_component_test(xmlrpc_in(xmlrpc_conn))
    res = test1.output()
    print res
コード例 #8
0
def test():
    from etl_test import etl_test
    import etl
    file_conn = etl.connector.localfile('../../../demo/input/input1.vcf')
    test = etl_test.etl_component_test(vcard_in(file_conn, name='vcf test'))
    test.check_output([{u'tel': u'(111) 555-1212', u'title': u'Shrimp Man', u'rev': u'20080424T195243Z', u'version': u'3.0', u'org': [u'BubbaGumpShrimp'], u'label': u'100 Waters Edge\\nBaytown, LA 30314\\nUnited States of America', u'email': u'*****@*****.**', u'fn': u'ForrestGump'}], 'main')
    res = test.output()
    print res
コード例 #9
0
def test():
    from etl_test import etl_test
    import etl
    file_conn = etl.connector.localfile('../../../demo/input/partner1.csv')
    test = etl_test.etl_component_test(csv_in(file_conn, name='csv test'))
    test.check_output([{'tel': '+32.81.81.37.00', 'id': '11', 'name': 'Fabien'}])
    res = test.output()
    print res
コード例 #10
0
def test():
    from etl_test import etl_test
    import etl

    sugarcrm_conn = sugarcrm_connector("admin", "sugarpasswd", url="http://192.168.0.7/sugarcrm/soap.php")
    test = etl_test.etl_component_test(etl.component.input.sugarcrm_in(sugarcrm_conn, "Contacts"))
    res = test.output()
    print res
コード例 #11
0
ファイル: dbf_in.py プロジェクト: odoousers2014/odoo-extra-1
def test():
    from etl_test import etl_test
    import etl
    file_conn = etl.connector.dbf_connector('../../../demo/input/dbf_file.dbf')# /input/DE000446.dbf
    test = etl_test.etl_component_test(dbf_in(file_conn, name='dbf file test'))
    import datetime
    test.check_output([{'CUSTOMER': '1', 'REF': '0021', 'NAME': 'ASUStek'}, {'CUSTOMER': '1', 'REF': '0022', 'NAME': 'Agrolait'}, {'CUSTOMER': '0', 'REF': '0023', 'NAME': 'Distrib PC'}])
    res = test.output()
コード例 #12
0
def test():
    from etl_test import etl_test
    import etl
    file_conn = etl.connector.localfile('../../../demo/input/partner1.csv')
    test = etl_test.etl_component_test(csv_in(file_conn, name='csv test'))
    test.check_output([{'tel': '+32.81.81.37.00', 'id': '11', 'name': 'Fabien'}])
    res = test.output()
    print res
コード例 #13
0
def test():
    #TODO
    from etl_test import etl_test
    import etl
    sugarcrm_conn=etl.connector.sugarcrm_connector('admin','sugarpasswd',url='http://192.168.0.7/sugarcrm/soap.php')
    test = etl_test.etl_component_test(sugarcrm_in(sugarcrm_conn, 'Contacts'))
    res=test.output()
    print res
コード例 #14
0
def test():
    from etl_test import etl_test
    import etl
    openobject_conn = etl.connector.openobject_connector('http://localhost:8069', 'etl_test', 'admin', 'admin', con_type='xmlrpc')
    test = etl_test.etl_component_test(openobject_out(openobject_conn, 'res.country'))
    test.check_input({'main': [{'name': 'India_test', 'code':'India_test'}]})
    test.check_output([{'name': 'India_test', 'code':'India_test'}], 'main')
    res = test.output()
コード例 #15
0
def test():
    from etl_test import etl_test
    import etl
    sql_conn = etl.connector.sql_connector('localhost', 5432, 'trunk', 'postgres', 'postgres')
    query =  'select * from etl_test'# execute the query you wish to
    test = etl_test.etl_component_test(sql_in(sql_conn, query))
    test.check_output([{'id': 1, 'name': 'a'}, {'id': 2, 'name': 'b'}])# output according to the executed query should be written over here.
    res = test.output()
    print res
コード例 #16
0
def test():
    from etl_test import etl_test
    import etl
    file_conn = etl.connector.openobject_connector('http://localhost:8069', 'trunk', 'admin', 'admin', con_type='xmlrpc')
    test = etl_test.etl_component_test(openobject_in(file_conn, 'res.country',[('name', '=', 'Algeria')]))
#    test.check_input({'main':[{'name':'Elec Import'}]})
    test.check_output([{'name': 'Algeria', 'code': 'DZ', 'id': 61}], 'main') # to be update
    res = test.output()
    print res
コード例 #17
0
def test():
    from etl_test import etl_test
    import etl
    sql_conn = etl.connector.sql_connector('localhost', 5432, 'trunk', 'postgres', 'postgres')
    test = etl_test.etl_component_test(sql_out(sql_conn, 'res_partner'))
    test.check_input({'main': [{'name': 'tinyerp belgium'}]})
    test.check_output([{'name': 'tinyerp belgium'}], 'main')
    res = test.output()
    print res
コード例 #18
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'@gmail.com'
    password = getpass.unix_getpass("Enter your password:")
    cal_conn=etl.connector.gcalendar_connector(user, password)

    out_calendar = gcalendar_out(cal_conn,'%Y-%m-%d %H:%M:%S')

    test = etl_test.etl_component_test(out_calendar)
    ooconnector=openobject_connector('http://localhost:8069', 'trunk_mra', 'admin', 'admin',con_type='xmlrpc')
    oo_in_event = etl_test.etl_component_test(etl.component.input.openobject_in(
                     ooconnector,'event.event',
                     fields=['name', 'date_begin', 'date_end'],
    ))
    res = test.output()
コード例 #19
0
def test():
    from etl_test import etl_test
    import etl
    facebook_conn = etl.connector.facebook_connector('http://facebook.com', '*****@*****.**')
    test = etl_test.etl_component_test(facebook_out(facebook_conn, 'set_events', name='facebook test'))
    test.check_output([{'id': 'event2', 'name': 'mustufa'}], 'main')
    test.check_input({'main': [{'id': 'event2', 'name': 'mustufa'}]})
    res = test.output()
    print res
コード例 #20
0
def test():
    """
    Test function.
    """
    from etl_test import etl_test
    import etl
    facebook_conn=facebook_connector('http://facebook.com', '*****@*****.**')
    test = etl_test.etl_component_test(etl.component.input.facebook_in(facebook_conn, 'get_user_events'))
    res=test.output()
    print res
コード例 #21
0
ファイル: sql_out.py プロジェクト: odoousers2014/odoo-extra-1
def test():
    from etl_test import etl_test
    import etl
    sql_conn = etl.connector.sql_connector('localhost', 5432, 'trunk',
                                           'postgres', 'postgres')
    test = etl_test.etl_component_test(sql_out(sql_conn, 'res_partner'))
    test.check_input({'main': [{'name': 'tinyerp belgium'}]})
    test.check_output([{'name': 'tinyerp belgium'}], 'main')
    res = test.output()
    print res
コード例 #22
0
def test():

    from etl_test import etl_test
    import etl
    sqlconnector_partner=sql_connector('localhost',5432, 'test', 'postgres', 'postgres')
    test = etl_test.etl_component_test(etl.component.input.sql_in(sqlconnector_partner,'select * from res_partner where id<=10 order by id'))
    res=test.output()
    print res

    pass
コード例 #23
0
def test():
    from etl_test import etl_test
    import etl
    facebook_conn = etl.connector.facebook_connector('http://facebook.com',
                                                     '*****@*****.**')
    test = etl_test.etl_component_test(
        facebook_out(facebook_conn, 'set_events', name='facebook test'))
    test.check_output([{'id': 'event2', 'name': 'mustufa'}], 'main')
    test.check_input({'main': [{'id': 'event2', 'name': 'mustufa'}]})
    res = test.output()
    print res
コード例 #24
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'@gmail.com'
    password = getpass.unix_getpass("Enter your password:")
    test = etl_test.etl_component_test(gmail_in(user, password))
    test.check_output([{'phone_numbers': [''], 'postal_addresses': [''], 'emails': [''], 'title': ''}], 'main')
    # here add the details of the contact in your gmail in the above mentioned format
    res = test.output()
コード例 #25
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'@gmail.com'
    password = getpass.unix_getpass("Enter your password:")

    ooconnector=openobject_connector('http://localhost:8069', 'quality', 'admin', 'admin',con_type='xmlrpc')
    oo_in_event = etl_test.etl_component_test(etl.component.input.openobject_in(
                     ooconnector,'res.partner.address',
                     fields=['name', 'email', 'phone'],
    ))
    res = oo_in_event.output()

    test = etl_test.etl_component_test(gmail_out(user, password,res))

#    test.check_output([{'phone_numbers': [''], 'postal_addresses': [''], 'emails': [''], 'title': ''}], 'main')
    # here add the details of the contact in your gmail in the above mentioned format
    res = test.output()
コード例 #26
0
def test():
    """
    Test function.
    """
    #TODO
    from etl_test import etl_test
    import etl
    xmlrpc_conn=xmlrpc_connector('localhost',8050)
    conn = xmlrpc_conn.start('import_data')
    test = etl_test.etl_component_test(etl.component.input.xmlrpc_in( etl.component.input.xmlrpc_in(xmlrpc_conn)))
    res=test.output()
    print res
コード例 #27
0
ファイル: data.py プロジェクト: 3dfxmadscientist/odoo-extra-1
def test():
    from etl_test import etl_test
    import etl
    inp_data = etl.component.input.data([
        {'id': 1, 'name': 'Fabien', 'country_id': 3},
        {'id': 2, 'name': 'Luc', 'country_id': 3},
        {'id': 3, 'name': 'Henry', 'country_id': 1}
    ])
    test = etl_test.etl_component_test(inp_data)
    test.check_output([{'country_id': 3, 'id': 1, 'name': 'Fabien'}, {'country_id': 3, 'id': 2, 'name': 'Luc'}, {'country_id': 1, 'id': 3, 'name': 'Henry'}] )
    res = test.output()
    print res
コード例 #28
0
def test():
    """
    Test function.
    """
    from etl_test import etl_test
    import etl
    facebook_conn = facebook_connector('http://facebook.com',
                                       '*****@*****.**')
    test = etl_test.etl_component_test(
        etl.component.input.facebook_in(facebook_conn, 'get_user_events'))
    res = test.output()
    print res
コード例 #29
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'/home/tiny/Desktop/')
    test = etl_test.etl_component_test(in_doc)
#    test.check_output([{'phone_numbers': [''], 'postal_addresses': [''], 'emails': [''], 'title': ''}], 'main')
    # here add the details of the contact in your gmail in the above mentioned format
    res = test.output()
    print res
コード例 #30
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'/home/tiny/Desktop/')
    test = etl_test.etl_component_test(in_doc)
    #    test.check_output([{'phone_numbers': [''], 'postal_addresses': [''], 'emails': [''], 'title': ''}], 'main')
    # here add the details of the contact in your gmail in the above mentioned format
    res = test.output()
    print res
コード例 #31
0
def test():

    from etl_test import etl_test
    import etl
    sqlconnector_partner = sql_connector('localhost', 5432, 'test', 'postgres',
                                         'postgres')
    test = etl_test.etl_component_test(
        etl.component.input.sql_in(
            sqlconnector_partner,
            'select * from res_partner where id<=10 order by id'))
    res = test.output()
    print res

    pass
コード例 #32
0
def test():
    """
    Test function.
    """
    #TODO
    from etl_test import etl_test
    import etl
    xmlrpc_conn = xmlrpc_connector('localhost', 8050)
    conn = xmlrpc_conn.start('import_data')
    test = etl_test.etl_component_test(
        etl.component.input.xmlrpc_in(
            etl.component.input.xmlrpc_in(xmlrpc_conn)))
    res = test.output()
    print res
コード例 #33
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'', '/home/tiny/Desktop/1st Review.ppt','PPT')
#    out_doc = gdoc_out(doc_conn, '', '/home/tiny/Desktop/changes.doc','DOC')
    out_doc = gdoc_out(doc_conn, '', '/home/tiny/Desktop/NAME_IN_FULL.doc','DOC')
    test = etl_test.etl_component_test(out_doc)
#    test.check_output([{'phone_numbers': [''], 'postal_addresses': [''], 'emails': [''], 'title': ''}], 'main')
    res = test.output()
    print res
コード例 #34
0
def test():
    from etl_test import etl_test
    import etl
    openobject_conn = etl.connector.openobject_connector(
        'http://localhost:8069',
        'etl_test',
        'admin',
        'admin',
        con_type='xmlrpc')
    test = etl_test.etl_component_test(
        openobject_out(openobject_conn, 'res.country'))
    test.check_input({'main': [{'name': 'India_test', 'code': 'India_test'}]})
    test.check_output([{'name': 'India_test', 'code': 'India_test'}], 'main')
    res = test.output()
コード例 #35
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'@gmail.com'
    password = getpass.unix_getpass("Enter your password:")
    cal_conn = etl.connector.gcalendar_connector(user, password)

    out_calendar = gcalendar_out(cal_conn, '%Y-%m-%d %H:%M:%S')

    test = etl_test.etl_component_test(out_calendar)
    ooconnector = openobject_connector('http://localhost:8069',
                                       'trunk_mra',
                                       'admin',
                                       'admin',
                                       con_type='xmlrpc')
    oo_in_event = etl_test.etl_component_test(
        etl.component.input.openobject_in(
            ooconnector,
            'event.event',
            fields=['name', 'date_begin', 'date_end'],
        ))
    res = test.output()
コード例 #36
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'', '/home/tiny/Desktop/1st Review.ppt','PPT')
    #    out_doc = gdoc_out(doc_conn, '', '/home/tiny/Desktop/changes.doc','DOC')
    out_doc = gdoc_out(doc_conn, '', '/home/tiny/Desktop/NAME_IN_FULL.doc',
                       'DOC')
    test = etl_test.etl_component_test(out_doc)
    #    test.check_output([{'phone_numbers': [''], 'postal_addresses': [''], 'emails': [''], 'title': ''}], 'main')
    res = test.output()
    print res
コード例 #37
0
ファイル: sql_in.py プロジェクト: odoousers2014/odoo-extra-1
def test():
    from etl_test import etl_test
    import etl
    sql_conn = etl.connector.sql_connector('localhost', 5432, 'trunk',
                                           'postgres', 'postgres')
    query = 'select * from etl_test'  # execute the query you wish to
    test = etl_test.etl_component_test(sql_in(sql_conn, query))
    test.check_output([{
        'id': 1,
        'name': 'a'
    }, {
        'id': 2,
        'name': 'b'
    }])  # output according to the executed query should be written over here.
    res = test.output()
    print res
コード例 #38
0
def test():
    from etl_test import etl_test
    import etl
    import getpass
    user = raw_input('Enter gmail username: '******'@gmail.com'
    password = getpass.unix_getpass("Enter your password:")
    test = etl_test.etl_component_test(gmail_in(user, password))
    test.check_output([{
        'phone_numbers': [''],
        'postal_addresses': [''],
        'emails': [''],
        'title': ''
    }], 'main')
    # here add the details of the contact in your gmail in the above mentioned format
    res = test.output()
コード例 #39
0
def test():
    from etl_test import etl_test
    import etl
    file_conn = etl.connector.localfile('../../../demo/input/input1.vcf')
    test = etl_test.etl_component_test(vcard_in(file_conn, name='vcf test'))
    test.check_output([{
        u'tel': u'(111) 555-1212',
        u'title': u'Shrimp Man',
        u'rev': u'20080424T195243Z',
        u'version': u'3.0',
        u'org': [u'BubbaGumpShrimp'],
        u'label':
        u'100 Waters Edge\\nBaytown, LA 30314\\nUnited States of America',
        u'email': u'*****@*****.**',
        u'fn': u'ForrestGump'
    }], 'main')
    res = test.output()
    print res
コード例 #40
0
def test():
    from etl_test import etl_test
    import etl
    file_conn = etl.connector.openobject_connector('http://localhost:8069',
                                                   'trunk',
                                                   'admin',
                                                   'admin',
                                                   con_type='xmlrpc')
    test = etl_test.etl_component_test(
        openobject_in(file_conn, 'res.country', [('name', '=', 'Algeria')]))
    #    test.check_input({'main':[{'name':'Elec Import'}]})
    test.check_output([{
        'name': 'Algeria',
        'code': 'DZ',
        'id': 61
    }], 'main')  # to be update
    res = test.output()
    print res
コード例 #41
0
def test():
    from etl_test import etl_test
    from etl import transformer
    import etl
    openobject_partner=etl.connector.openobject_connector('http://localhost:8869', 'trunk', 'admin', 'admin',con_type='xmlrpc')
    transformer_description= {'title':transformer.STRING,'name':transformer.STRING,'street':transformer.STRING,'street2':transformer.STRING,'birthdate':transformer.DATE}
    transformer=transformer(transformer_description)
    openobject_in1= etl.component.input.openobject_in(
                 openobject_partner,'res.partner.address',
                 fields=['partner_id','title', 'name', 'street', 'street2' , 'phone' , 'city' ,  'zip' ,'state_id' , 'country_id' , 'mobile', 'birthdate'],
                 transformer=transformer)
    filter_criteria=[
        {'name':'Partner','filter':'"%(Partner)s".lower() or ""','operator':'==','operand':"'leclerc'",'condition':'or'},
        {'name':'Address Name','operator':'==','operand':"'Fabien Pinckaers'"}
        ]

    test1 = data_filter_component=etl_test.etl_component_test(etl.component.transform.data_filter(filter_criteria,transformer=transformer))
    res = test1.output()
    print res
コード例 #42
0
ファイル: sort.py プロジェクト: odoousers2014/odoo-extra-1
def test():
    from etl_test import etl_test
    test = etl_test.etl_component_test(sort('name'))
    test.check_input(
        {'main': [{
            'id': 1,
            'name': 'OpenERP'
        }, {
            'id': 2,
            'name': 'Fabien'
        }]})
    test.check_output([{
        'id': 2,
        'name': 'Fabien'
    }, {
        'id': 1,
        'name': 'OpenERP'
    }], 'main')
    res = test.output()
コード例 #43
0
def test():
    from etl_test import etl_test
    import etl
    openobject_partner = openobject_connector('http://localhost:8070',
                                              'trunk',
                                              'admin',
                                              'a',
                                              obj='object',
                                              con_type='socket')
    test = etl_test.etl_component_test(
        etl.component.input.openobject_in(
            openobject_partner,
            'res.partner.address',
            fields=[
                'partner_id', 'title', 'name', 'street', 'street2', 'phone',
                'city', 'zip', 'state_id', 'country_id', 'mobile', 'birthdate'
            ],
        ))
    res = test.output()
    print res
コード例 #44
0
ファイル: join.py プロジェクト: odoousers2014/odoo-extra-1
def test():
    from etl_test import etl_test
    import etl
    input_part = [
        {'id': 1, 'name': 'Fabien', 'country_id': 3},
        {'id': 2, 'name': 'Luc', 'country_id': 3},
        {'id': 3, 'name': 'Henry', 'country_id': 1}
    ]
    input_cty = [{'id': 1, 'name': 'Belgium'}, {'id': 3, 'name': 'France'}]
    map_keys = {'main': {
        'id': "main['id']",
        'name': "main['id'].upper()",
        'country': "country[main['country_id']]['name']"
    }}
    join_keys = {
         'country': 'id'
    }
    test = etl_test.etl_component_test(join(map_keys, join_keys))
    test.check_input({'partner':input_part, 'countries': input_cty})
    print test.output()
コード例 #45
0
def test():
    from etl_test import etl_test
    import etl
    from etl import transformer
    import getpass
    user = raw_input('Enter gmail username: '******'@gmail.com'
    password = getpass.unix_getpass("Enter your password:")
    cal_conn=etl.connector.gcalendar_connector(user, password)
    in_calendar = gcalendar_in(cal_conn)

    test = etl_test.etl_component_test(in_calendar)

#    transformer_description= {'date_begin':transformer.DATETIME, 'date_end':transformer.DATETIME}
#    transformer=transformer(transformer_description)

#    test.check_output([{'date_end': '2009-05-23 15:00:00', 'date_begin': '2009-05-23 14:00:00', 'name': 'Outing'}, {'date_end': '2009-05-23 10:00:00', 'date_begin': '2009-05-23 09:00:00', 'name': 'Reporting'}, {'date_end': '2009-06-07 00:00:00', 'date_begin': '2009-06-06 00:00:00', 'name': 'Submission'}], 'main')
    # here add the details of the contact in your gmail in the above mentioned format
#    test1 = gcalender_in_component=etl_test.etl_component_test(etl.component.input.gcalendar_in(cal_conn,transformer=transformer))
    res = test.output()
コード例 #46
0
def test():
    from etl_test import etl_test
    import etl
    from etl import transformer
    import getpass
    user = raw_input('Enter gmail username: '******'@gmail.com'
    password = getpass.unix_getpass("Enter your password:")
    cal_conn = etl.connector.gcalendar_connector(user, password)
    in_calendar = gcalendar_in(cal_conn)

    test = etl_test.etl_component_test(in_calendar)

    #    transformer_description= {'date_begin':transformer.DATETIME, 'date_end':transformer.DATETIME}
    #    transformer=transformer(transformer_description)

    #    test.check_output([{'date_end': '2009-05-23 15:00:00', 'date_begin': '2009-05-23 14:00:00', 'name': 'Outing'}, {'date_end': '2009-05-23 10:00:00', 'date_begin': '2009-05-23 09:00:00', 'name': 'Reporting'}, {'date_end': '2009-06-07 00:00:00', 'date_begin': '2009-06-06 00:00:00', 'name': 'Submission'}], 'main')
    # here add the details of the contact in your gmail in the above mentioned format
    #    test1 = gcalender_in_component=etl_test.etl_component_test(etl.component.input.gcalendar_in(cal_conn,transformer=transformer))
    res = test.output()
コード例 #47
0
def test():

    from etl_test import etl_test
    import etl
    input_part = [{
        'id': 1,
        'name': 'Fabien',
        'country_id': 3
    }, {
        'id': 2,
        'name': 'Luc',
        'country_id': 3
    }, {
        'id': 3,
        'name': 'Henry',
        'country_id': 1
    }]
    input_cty = [{'id': 1, 'name': 'Belgium'}, {'id': 3, 'name': 'France'}]
    map_keys = {
        'main': {
            'id': "main['id']",
            'name': "main['id'].upper()",
            'country': "country_var[main['country_id']]['name']"
        }
    }
    #    def preprocess(self, channels):
    #        cdict = {}
    #    for trans in channels['country']:
    #        for iterator in trans:
    #            for d in iterator:
    #                cdict[d['id']] = d
    #    return {'country_var': cdict}
    test = etl_test.etl_component_test(map(map_keys, None))
    test.check_input({'partner': input_part, 'countries': input_cty})
    test.check_output({'partner': input_part, 'countries': input_cty})
    print test.output()
コード例 #48
0
                                        channel = "invalid_format"
                                        break
                            if self.schema[f].get('size', False):
                                if len(d[f]) > int(self.schema[f]['size']):
                                    channel = 'invalid_size'
                                    break
                        yield d, channel


def test():
    from etl_test import etl_test
    from etl import transformer
    input_part = [
        {'id': 1L, 'name': 'Fabien', 'active': True, 'birth_date': '2009-02-01', 'amount': 209.58},
        {'id': 2L, 'name': 'Luc', 'active': True, 'birth_date': '2007-02-01', 'amount': 211.25},
        {'id': 3L, 'name': 'Henry', 'active': True, 'birth_date': '2006-02-01', 'amount': 219.20},
    ]
    schema= {
		'id': {'type': 'long', 'key': True, 'Is_Null': True},
		'name': {'type': 'str', 'size': '10', 'Is_NULL': False},
		'active': {'type': 'bool', 'Is_NULL': False},
    	'birth_date': {'type': 'datetime.date', 'Is_NULL': False, 'format': '%y-%m-%d'},
		'amount': {'type': 'float', 'Is_NULL': True}
	}
    test = etl_test.etl_component_test(schema_validator(schema))
    test.check_input({'main': input_part})
    print test.output()

if __name__ == '__main__':
    test()
コード例 #49
0
                   if d in unique_datas:
                       yield d, "duplicate"
                   else :
                       unique_datas.append(d)
        for d in unique_datas:
            yield d, "main"

def test():

    from etl_test import etl_test
    from etl import transformer
    input_part = [
        {'id': 1L, 'name': 'Fabien', 'active': True, 'birth_date': '2009-02-01', 'amount': 209.58},
        {'id': 1L, 'name': 'Fabien', 'active': True, 'birth_date': '2009-02-01', 'amount': 209.58},
        {'id': 3L, 'name': 'Henry', 'active': True, 'birth_date': '2006-02-01', 'amount': 219.20},
    ]
    unique_part = [
        {'id': 1L, 'name': 'Fabien', 'active': True, 'birth_date': '2009-02-01', 'amount': 209.58},
        {'id': 3L, 'name': 'Henry', 'active': True, 'birth_date': '2006-02-01', 'amount': 219.20},
    ]
    duplicate_part = [
        {'id': 1L, 'name': 'Fabien', 'active': True, 'birth_date': '2009-02-01', 'amount': 209.58},
    ]
    test = etl_test.etl_component_test(unique())
    test.check_input({'main': input_part})
    test.check_output(unique_part, 'main')
    print test.output()

if __name__ == '__main__':
    test()
コード例 #50
0
def test():
    from etl_test import etl_test
    import etl
    facebook_conn = etl.connector.facebook_connector('http://facebook.com', '*****@*****.**')
    test1 = etl_test.etl_component_test(facebook_in(facebook_conn, 'get_user_events'))
    res = test1.output()
コード例 #51
0
ファイル: diff.py プロジェクト: 3dfxmadscientist/odoo-extra-1
    input_part = [
    {'id': 1L, 'name': 'Fabien', 'address': 'france'},
    {'id': 1L, 'name': 'Fabien', 'address': 'belgium'},
    {'id': 3L, 'name': 'harshad', 'address': 'india'},
    ]
    modify = [
    {'id': 1L, 'name': 'Fabien', 'address': 'india'},
    {'id': 1L, 'name': 'Fabien', 'address': 'belgium'},
    {'id': 3L, 'name': 'harshad', 'address': 'india'},
    ]

    add = [
    {'id': 4L, 'name': 'henry', 'address': 'spain'}
    ]


    modify = [
    {'id': 1L, 'name': 'Fabien', 'address': 'india'}
    ]

    remove = [
    {'id': 1L, 'name': 'Fabien', 'address': 'belgium'},
    ]
    test = etl_test.etl_component_test(diff(['id']))
    test.check_input({'main':input_part})
    test.check_output(modify, 'main')
    print test.output()

if __name__ == '__main__':
    test()
コード例 #52
0
ファイル: sort.py プロジェクト: 3dfxmadscientist/odoo-extra-1
def test():
    from etl_test import etl_test
    test = etl_test.etl_component_test(sort('name'))
    test.check_input({'main': [{'id': 1, 'name': 'OpenERP'}, {'id': 2, 'name': 'Fabien'}]})
    test.check_output([{'id': 2, 'name': 'Fabien'}, {'id': 1, 'name': 'OpenERP'}], 'main')
    res = test.output()
コード例 #53
0
            'id': 1L,
            'name': 'Fabien',
            'address': 'belgium'
        },
        {
            'id': 3L,
            'name': 'harshad',
            'address': 'india'
        },
    ]

    add = [{'id': 4L, 'name': 'henry', 'address': 'spain'}]

    modify = [{'id': 1L, 'name': 'Fabien', 'address': 'india'}]

    remove = [
        {
            'id': 1L,
            'name': 'Fabien',
            'address': 'belgium'
        },
    ]
    test = etl_test.etl_component_test(diff(['id']))
    test.check_input({'main': input_part})
    test.check_output(modify, 'main')
    print test.output()


if __name__ == '__main__':
    test()