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([])
Beispiel #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
Beispiel #3
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[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()
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([])
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()
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
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
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
Beispiel #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
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
Beispiel #11
0
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()
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
Beispiel #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
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()
Beispiel #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
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
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
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()
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
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
Beispiel #21
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
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
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
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()
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()
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
Beispiel #27
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
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
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
Beispiel #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
Beispiel #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
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
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
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()
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()
Beispiel #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
Beispiel #37
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
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()
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #42
0
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()
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
Beispiel #44
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[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()
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()
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()
Beispiel #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()
                                        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()
Beispiel #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()
Beispiel #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()
Beispiel #51
0
    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()
Beispiel #52
0
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()
Beispiel #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()