示例#1
0
 def test_parse_contracts(self):
     self.maxDiff = None
     api_result = make_api_result("corp/contracts.xml")
     result = evelink_c.parse_contracts(api_result)
     self.assertEqual(result, {
             5966: {
                 'id': 5966,
                 'issuer': 154416088,
                 'issuer_corp': 154430949,
                 'assignee': 0,
                 'acceptor': 0,
                 'start': 60014659,
                 'end': 60014659,
                 'type': 'ItemExchange',
                 'status': 'Outstanding',
                 'title': '',
                 'corp': False,
                 'availability': 'Public',
                 'issued': api.parse_ts('2010-02-23 11:28:00'),
                 'expired': api.parse_ts('2010-03-24 11:28:00'),
                 'accepted': None,
                 'completed': None,
                 'days': 0,
                 'price': 5000.0,
                 'reward': 0.0,
                 'collateral': 0.0,
                 'buyout': 0.0,
                 'volume': 0.01,
             },
             5968: {
                 'id': 5968,
                 'issuer': 154416088,
                 'issuer_corp': 154430949,
                 'assignee': 154430949,
                 'acceptor': 0,
                 'start': 60003760,
                 'end': 60003760,
                 'type': 'ItemExchange',
                 'status': 'Outstanding',
                 'title': '',
                 'corp': False,
                 'availability': 'Private',
                 'issued': api.parse_ts('2010-02-25 11:33:00'),
                 'expired': api.parse_ts('2010-03-26 11:33:00'),
                 'accepted': None,
                 'completed': None,
                 'days': 0,
                 'price': 0.00,
                 'reward': 0.00,
                 'collateral': 0.00,
                 'buyout': 0.00,
                 'volume': 0.03,
             }
         })
示例#2
0
 def test_parse_contracts(self):
     api_result, _, _ = make_api_result("corp/contracts.xml")
     result = evelink_c.parse_contracts(api_result)
     self.assertEqual(
         result, {
             5966: {
                 'id': 5966,
                 'issuer': 154416088,
                 'issuer_corp': 154430949,
                 'assignee': 0,
                 'acceptor': 0,
                 'start': 60014659,
                 'end': 60014659,
                 'type': 'ItemExchange',
                 'status': 'Outstanding',
                 'title': '',
                 'corp': False,
                 'availability': 'Public',
                 'issued': api.parse_ts('2010-02-23 11:28:00'),
                 'expired': api.parse_ts('2010-03-24 11:28:00'),
                 'accepted': None,
                 'completed': None,
                 'days': 0,
                 'price': 5000.0,
                 'reward': 0.0,
                 'collateral': 0.0,
                 'buyout': 0.0,
                 'volume': 0.01,
             },
             5968: {
                 'id': 5968,
                 'issuer': 154416088,
                 'issuer_corp': 154430949,
                 'assignee': 154430949,
                 'acceptor': 0,
                 'start': 60003760,
                 'end': 60003760,
                 'type': 'ItemExchange',
                 'status': 'Outstanding',
                 'title': '',
                 'corp': False,
                 'availability': 'Private',
                 'issued': api.parse_ts('2010-02-25 11:33:00'),
                 'expired': api.parse_ts('2010-03-26 11:33:00'),
                 'accepted': None,
                 'completed': None,
                 'days': 0,
                 'price': 0.00,
                 'reward': 0.00,
                 'collateral': 0.00,
                 'buyout': 0.00,
                 'volume': 0.03,
             }
         })
 def contracts(self, api_result=None):
     """Returns a record of all contracts for a specified character"""
     return api.APIResult(parse_contracts(api_result.result), api_result.timestamp, api_result.expires)
示例#4
0
 def contracts(self):
     """Get information about corp contracts."""
     api_result = self.api.get('corp/Contracts')
     return parse_contracts(api_result)
示例#5
0
文件: char.py 项目: elly/evelink
 def contracts(self):
     """Returns a record of all contracts for a specified character"""
     api_result = self.api.get('char/Contracts',
         {'characterID': self.char_id})
     return parse_contracts(api_result)
示例#6
0
文件: corp.py 项目: ayust/evelink
 def contracts(self, contract_id = None, api_result=None):
     """Get information about corp contracts."""
     return api.APIResult(parse_contracts(api_result.result), api_result.timestamp, api_result.expires)
示例#7
0
 def contracts(self, contract_id=None, api_result=None):
     """Get information about corp contracts."""
     return api.APIResult(parse_contracts(api_result.result),
                          api_result.timestamp, api_result.expires)
示例#8
0
 def contracts(self, contract_id=None, api_result=None):
     """Returns a record of all contracts for a specified character"""
     return api.APIResult(parse_contracts(api_result.result),
                          api_result.timestamp, api_result.expires)
示例#9
0
文件: corp.py 项目: dinoboff/evelink
    def contracts(self, api_result=None):
        """Get information about corp contracts."""
        if api_result is None:
            api_result = self.api.get('corp/Contracts')

        return api.APIResult(parse_contracts(api_result.result), api_result.timestamp, api_result.expires)