Exemplo n.º 1
0
    def __init__(self,
                 data_access,
                 type_id=None,
                 type_name=None,
                 blueprint_original=None,
                 blueprint_me_level=0,
                 blueprint_te_level=0,
                 blueprint_runs=0):
        '''
        Constructor
        '''

        # initialize object and get basic data
        EveOnlineInvType.__init__(self,
                                  data_access,
                                  type_id=type_id,
                                  type_name=type_name)

        self.blueprint_type_id = self.data_access.get_bp_id_for_type_id(self.type_id)
        self.blueprint_produced_quantity = self.data_access.get_produced_quantity_per_run_for_bp_id(self.blueprint_type_id)

        self.blueprint_original = blueprint_original
        self.blueprint_me_level = blueprint_me_level
        self.blueprint_te_level = blueprint_te_level
        self.blueprint_runs = blueprint_runs
Exemplo n.º 2
0
 def setUp(self):
     '''
     Set-up of the testing environment
     '''
     self.db_access_object = DBAccessSQLite(self.DATA_FILE)
     self.data_access_object = EveDB(self.db_access_object)
     self.eve_item_manufacturing = EveOnlineInvType(self.data_access_object)
Exemplo n.º 3
0
class TestEveItem(unittest.TestCase):
    '''
    Unit test for class EveItem
    '''

    DATA_FILE = '../data/eve.db'

    maxDiff = None

    def setUp(self):
        '''
        Set-up of the testing environment
        '''
        self.db_access_object = DBAccessSQLite(self.DATA_FILE)
        self.data_access_object = EveDB(self.db_access_object)
        self.eve_item_manufacturing = EveOnlineInvType(self.data_access_object)

    def tearDown(self):
        '''
        Tear-down of the testing environment
        '''
        self.db_access_object.close()

    def test_get_item_charon(self):
        '''
        Test for loading data to object attributes
        '''
        self.eve_item_manufacturing.get_item(type_name="Charon")
        self.failUnlessEqual("Charon",
                             self.eve_item_manufacturing.type_name)

    def test_get_item_ark(self):
        '''
        Test for loading data to object attributes - Ark
        '''
        self.eve_item_manufacturing.get_item(type_id=28850)
        self.failUnlessEqual("Ark",
                             self.eve_item_manufacturing.type_name)