# Path: ma/xml_loader/quickfix_loader.py
# class QuickfixLoader(object):
#     """Class to load Quickfix Loader for MA.
#     This class get information stored in XML file
#     into a python module"""
#     def __init__(self):
#         self.items = {}
#         self.load_xml(QUICKFIX_XML)
# 
#     def load_xml(self, file_name):
#         '''Method to load Quickfixes strings.
#         This method open XML file and load info inside a
#         dictionary data structure'''
# 
#         tree = elemTree.parse(file_name)
#         root = tree.getroot()
#         orig_item = None
# 
#         for item in root.iter():
#             if item.tag == 'item':
#                 orig_item = item.attrib
# 
#             if item.tag == 'replacer':
#                 replacer = item.attrib
#                 self.items[orig_item['target']] = [orig_item, replacer]
# 
#     def get_include(self, target):
#         '''Method to get include value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['include']
# 
#     def get_type(self, target):
#         '''Method to get type value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['type']
# 
#     def get_value(self, target):
#         '''Method to get type value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['value']
# 
#     def get_define(self, target):
#         '''Method to get define value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['define']


import unittest
from ma.xml_loader.quickfix_loader import QuickfixLoader
    Contributors:
        * Diego Fernandez-Merjildo <merjildo@br.ibm.com>
"""


class QuickfixLoaderTest(unittest.TestCase):
    """ Test cases for the quickfix loader"""

    @unittest.skip
    def get_include_test(self):
        """This test aim to check correct include value return from
        get_include() method in QuickfixLoader class"""
        quickfix_loader = QuickfixLoader()
        self.assertTrue(quickfix_loader.get_include('__bid128_inf') == 'math.h')
        self.assertTrue(quickfix_loader.get_include('__bid64_exp2') == 'math.h')
        self.assertTrue(quickfix_loader.get_include('__bid32_to_uint16_xint') == '')

    @unittest.skip
    def get_type_test(self):
        '''This test aim to check correct replace return from
        get_type() method in QuickfixLoader class'''
        quickfix_loader = QuickfixLoader()
        self.assertTrue(quickfix_loader.get_type('__bid64_sub') == 'operator')
        self.assertTrue(quickfix_loader.get_type('__bid64dq_div') == 'operator')
        self.assertTrue(quickfix_loader.get_type('__bid32_log') == 'function')

    @unittest.skip
    def get_value_test(self):
        """This test aim to check correct value return from
        get_value() method in QuickfixLoader class"""

# Path: ma/xml_loader/quickfix_loader.py
# class QuickfixLoader(object):
#     """Class to load Quickfix Loader for MA.
#     This class get information stored in XML file
#     into a python module"""
#     def __init__(self):
#         self.items = {}
#         self.load_xml(QUICKFIX_XML)
# 
#     def load_xml(self, file_name):
#         '''Method to load Quickfixes strings.
#         This method open XML file and load info inside a
#         dictionary data structure'''
# 
#         tree = elemTree.parse(file_name)
#         root = tree.getroot()
#         orig_item = None
# 
#         for item in root.iter():
#             if item.tag == 'item':
#                 orig_item = item.attrib
# 
#             if item.tag == 'replacer':
#                 replacer = item.attrib
#                 self.items[orig_item['target']] = [orig_item, replacer]
# 
#     def get_include(self, target):
#         '''Method to get include value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['include']
# 
#     def get_type(self, target):
#         '''Method to get type value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['type']
# 
#     def get_value(self, target):
#         '''Method to get type value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['value']
# 
#     def get_define(self, target):
#         '''Method to get define value for selected target'''
#         replacer = self.items[target][1]
#         return replacer['define']


# Path: tests/quickfix_test.py
import unittest
from ma.xml_loader.quickfix_loader import QuickfixLoader

    Contributors:
        * Diego Fernandez-Merjildo <merjildo@br.ibm.com>
"""


class QuickfixLoaderTest(unittest.TestCase):
    """ Test cases for the quickfix loader"""

    @unittest.skip
    def get_include_test(self):
        """This test aim to check correct include value return from
        get_include() method in QuickfixLoader class"""
        quickfix_loader = QuickfixLoader()
        self.assertTrue(quickfix_loader.get_include('__bid128_inf') == 'math.h')
        self.assertTrue(quickfix_loader.get_include('__bid64_exp2') == 'math.h')
        self.assertTrue(quickfix_loader.get_include('__bid32_to_uint16_xint') == '')

    @unittest.skip
    def get_type_test(self):
        '''This test aim to check correct replace return from
        get_type() method in QuickfixLoader class'''
        quickfix_loader = QuickfixLoader()
        self.assertTrue(quickfix_loader.get_type('__bid64_sub') == 'operator')
        self.assertTrue(quickfix_loader.get_type('__bid64dq_div') == 'operator')
        self.assertTrue(quickfix_loader.get_type('__bid32_log') == 'function')

    @unittest.skip
    def get_value_test(self):
        """This test aim to check correct value return from
        get_value() method in QuickfixLoader class"""

        quickfix_loader = QuickfixLoader()