tests/catalog_api.py
def _dummy_data_generator(conn):
    """Helper function to generate sample data for the unit tests."""
    data_files = []
    f = CatalogAttributes('operator_file.zip', 'operator', '2017-01-01 00:00:00', 46445454332,
                          True, True, 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', {'filename_check': True})
    data_files.append(f)
    f = CatalogAttributes('gsma_file.zip', 'gsma_tac', '2016-07-07 00:00:00', 2342344,
                          False, False, '40a37f83-21cb-4ab4-bba5-4032b1347273')
    data_files.append(f)
    f = CatalogAttributes('stolen_file.zip', 'stolen_list', '2016-09-09 00:00:00', 54543,
                          True, True, '014a3782-9826-4665-8830-534013b59cc5')
    data_files.append(f)

    for f in data_files:
        _populate_data_catalog_table(conn, f.filename, f.file_type, f.compressed_size_bytes, f.modified_time,
                                     f.is_valid_zip, f.is_valid_format, f.md5, f.extra_attributes,
                                     first_seen='2017-10-31 00:00:00', last_seen='2017-10-31 00:00:00')

    f = CatalogAttributes('pairing_file.zip', 'pairing_list', '2016-08-08 00:00:00', 1564624,
                          True, False, 'd0481db2-bdc8-43da-a69e-ea7006bd7a7c')
    _populate_data_catalog_table(conn, f.filename, f.file_type, f.compressed_size_bytes, f.modified_time,
                                 f.is_valid_zip, f.is_valid_format, f.md5, f.extra_attributes,
                                 first_seen='2017-12-12 00:00:00', last_seen='2017-12-12 00:00:00')
Helper function to generate sample data for the unit tests.
Helper function to generate sample data for the unit tests.
Helper function to generate sample data for the unit tests .
def _dummy_data_generator(conn):
    data_files = []
    f = CatalogAttributes('operator_file.zip', 'operator', '2017-01-01 00:00:00', 46445454332,
                          True, True, 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', {'filename_check': True})
    data_files.append(f)
    f = CatalogAttributes('gsma_file.zip', 'gsma_tac', '2016-07-07 00:00:00', 2342344,
                          False, False, '40a37f83-21cb-4ab4-bba5-4032b1347273')
    data_files.append(f)
    f = CatalogAttributes('stolen_file.zip', 'stolen_list', '2016-09-09 00:00:00', 54543,
                          True, True, '014a3782-9826-4665-8830-534013b59cc5')
    data_files.append(f)
    for f in data_files:
        _populate_data_catalog_table(conn, f.filename, f.file_type, f.compressed_size_bytes, f.modified_time,
                                     f.is_valid_zip, f.is_valid_format, f.md5, f.extra_attributes,
                                     first_seen='2017-10-31 00:00:00', last_seen='2017-10-31 00:00:00')
    f = CatalogAttributes('pairing_file.zip', 'pairing_list', '2016-08-08 00:00:00', 1564624,
                          True, False, 'd0481db2-bdc8-43da-a69e-ea7006bd7a7c')
    _populate_data_catalog_table(conn, f.filename, f.file_type, f.compressed_size_bytes, f.modified_time,
                                 f.is_valid_zip, f.is_valid_format, f.md5, f.extra_attributes,
                                 first_seen='2017-12-12 00:00:00', last_seen='2017-12-12 00:00:00')
def _dummy_data_generator ( conn ) : data_files = [ ] f = CatalogAttributes ( 'operator_file.zip' , 'operator' , '2017-01-01 00:00:00' , 46445454332 , True , True , 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11' , { 'filename_check' : True } ) data_files . append ( f ) f = CatalogAttributes ( 'gsma_file.zip' , 'gsma_tac' , '2016-07-07 00:00:00' , 2342344 , False , False , '40a37f83-21cb-4ab4-bba5-4032b1347273' ) data_files . append ( f ) f = CatalogAttributes ( 'stolen_file.zip' , 'stolen_list' , '2016-09-09 00:00:00' , 54543 , True , True , '014a3782-9826-4665-8830-534013b59cc5' ) data_files . append ( f ) for f in data_files : _populate_data_catalog_table ( conn , f . filename , f . file_type , f . compressed_size_bytes , f . modified_time , f . is_valid_zip , f . is_valid_format , f . md5 , f . extra_attributes , first_seen = '2017-10-31 00:00:00' , last_seen = '2017-10-31 00:00:00' ) f = CatalogAttributes ( 'pairing_file.zip' , 'pairing_list' , '2016-08-08 00:00:00' , 1564624 , True , False , 'd0481db2-bdc8-43da-a69e-ea7006bd7a7c' ) _populate_data_catalog_table ( conn , f . filename , f . file_type , f . compressed_size_bytes , f . modified_time , f . is_valid_zip , f . is_valid_format , f . md5 , f . extra_attributes , first_seen = '2017-12-12 00:00:00' , last_seen = '2017-12-12 00:00:00' )
Helper function to generate sample data for the unit tests.
Helper function to generate sample data for the unit tests .
"""Helper function to generate sample data for the unit tests."""
conn