# -*- coding: utf-8 -*-

"""
This file contains unittests for converter.py.
"""
import unittest
import glob
from soft4recieve_write_Rel2.main_lib import get_path,sort_files
from soft4recieve_write_Rel2.set_working_path import test_data
from soft4recieve_write_Rel2.Converter.converter import get_available_data
from soft4recieve_write_Rel2.Converter.converter import show_available_data

if __name__ == "__main__":
    # Create list of files for converting
    file_list = glob.glob(get_path(test_data)['common'] + '*.dat')
    # Create dictionary of binary files for converting
    file_dict = sort_files(file_list,'bin')
    # Get list of available data
    new_packets = get_available_data(file_dict)
    result = show_available_data(new_packets)
    print result
# -*- coding: utf-8 -*-

"""
This file contains unittests for converter.py.
"""
import unittest
from soft4recieve_write_Rel2.set_working_path import test_path
from soft4recieve_write_Rel2.Converter.converter import get_available_data
from soft4recieve_write_Rel2.Converter.converter import sort_file_dict
from soft4recieve_write_Rel2.Converter.converter import show_available_data
from soft4recieve_write_Rel2.Converter.converter import get_user_data

if __name__ == "__main__":
    # Create dictionary of binary files for converting
    file_dict = sort_file_dict(test_path['common'])
    # Get list of available data
    new_packets = get_available_data(file_dict)
    # Show list of available data
    show_available_data(new_packets)
    print 'new_packets: ', len(new_packets)
#    print type(new_packets)
#    print new_packets[0:2]
#    name = lambda name:([p for p in new_packets if p['cut_name'] == name])
#    buf = name('Sec') + name('Count')
#    print 'buf = ',buf
    result = get_user_data(new_packets)
    print 'len: ', len(result)
    for i in result:
        print i['cut_name']
Example #3
0
"""
This file contains unittests for get_available_data function in converter.py
"""
import unittest
import copy
from soft4recieve_write_Rel2.set_working_path import test_path
from soft4recieve_write_Rel2.Converter.mapping_functions import func_pool
from soft4recieve_write_Rel2.Converter.converter import get_available_data, sort_file_dict
from soft4recieve_write_Rel2.Converter.converter import edit_func_pool, get_user_data, show_available_data


def test1(file_dict):
    """

    """
    pass


if __name__ == "__main__":
    # Create dictionary of binary files for converting
    file_dict = sort_file_dict(test_path['common'])
    data = get_available_data(file_dict)
    show_available_data(data)
    user_data = get_user_data(data)
    print '==============================='
    result = edit_func_pool(user_data)
    #    print result
    for key in result:
        print result[key]
    print result.keys()
"""
This file contains unittests for get_available_data function in converter.py
"""
import unittest
import copy
from soft4recieve_write_Rel2.set_working_path import test_path
from soft4recieve_write_Rel2.Converter.mapping_functions import func_pool
from soft4recieve_write_Rel2.Converter.converter import get_available_data, sort_file_dict
from soft4recieve_write_Rel2.Converter.converter import edit_func_pool, get_user_data, show_available_data

def test1(file_dict):
    """

    """
    pass


if __name__ == "__main__":
    # Create dictionary of binary files for converting
    file_dict = sort_file_dict(test_path['common'])
    data = get_available_data(file_dict)
    show_available_data(data)
    user_data = get_user_data(data)
    print '==============================='
    result = edit_func_pool(user_data)
#    print result
    for key in result:
        print result[key]
    print result.keys()
Example #5
0
# -*- coding: utf-8 -*-
"""
This file contains unittests for converter.py.
"""
import unittest
import glob
from soft4recieve_write_Rel2.main_lib import get_path, sort_files
from soft4recieve_write_Rel2.set_working_path import conv_data, test_data
from soft4recieve_write_Rel2.Converter.converter import get_available_data
from soft4recieve_write_Rel2.Converter.converter import show_available_data
from soft4recieve_write_Rel2.Converter.converter import get_user_data
from soft4recieve_write_Rel2.Converter.converter import user_group_name2str

if __name__ == "__main__":
    # Create list of files for converting
    file_list = glob.glob(get_path(test_data)['common'] + '*.dat')
    # Create dictionary of binary files for converting
    file_dict = sort_files(file_list, 'bin')
    # Get list of available data
    new_packets = get_available_data(file_dict)
    # Show list of available data
    show_available_data(new_packets)
    user_data = get_user_data(new_packets)
    #    print user_data
    result = user_group_name2str(user_data)
    print 'Data group name is: ', result
Example #6
0
# -*- coding: utf-8 -*-
"""
This file contains unittests for converter.py.
"""
import unittest
import glob
from soft4recieve_write_Rel2.main_lib import get_path, sort_files
from soft4recieve_write_Rel2.set_working_path import test_data
from soft4recieve_write_Rel2.Converter.converter import get_available_data
from soft4recieve_write_Rel2.Converter.converter import show_available_data

if __name__ == "__main__":
    # Create list of files for converting
    file_list = glob.glob(get_path(test_data)['common'] + '*.dat')
    # Create dictionary of binary files for converting
    file_dict = sort_files(file_list, 'bin')
    # Get list of available data
    new_packets = get_available_data(file_dict)
    result = show_available_data(new_packets)
    print result