예제 #1
0
 def test_parse_contract_items(self):
     api_result = make_api_result("char/contract_items.xml")
     result = evelink_c.parse_contract_items(api_result)
     self.assertEqual(result, [
         {'id': 779703190, 'quantity': 490, 'type_id': 17867, 'action': 'offered', 'singleton': False},
         {'id': 779703191, 'quantity': 60, 'type_id': 17868, 'action': 'offered', 'singleton': False},
         {'id': 779703192, 'quantity': 8360, 'type_id': 1228, 'action': 'offered', 'singleton': False},
         {'id': 779703193, 'quantity': 16617, 'type_id': 1228, 'action': 'offered', 'singleton': False},
     ])
예제 #2
0
 def test_parse_contract_items(self):
     api_result, _, _ = make_api_result("char/contract_items.xml")
     result = evelink_c.parse_contract_items(api_result)
     self.assertEqual(
         result,
         [
             {"id": 779703190, "quantity": 490, "type_id": 17867, "action": "offered", "singleton": False},
             {"id": 779703191, "quantity": 60, "type_id": 17868, "action": "offered", "singleton": False},
             {"id": 779703192, "quantity": 8360, "type_id": 1228, "action": "offered", "singleton": False},
             {"id": 779703193, "quantity": 16617, "type_id": 1228, "action": "offered", "singleton": False},
             {
                 "id": 779703194,
                 "quantity": 1,
                 "type_id": 973,
                 "action": "offered",
                 "singleton": True,
                 "raw_quantity": -2,
             },
         ],
     )
예제 #3
0
 def test_parse_contract_items(self):
     api_result, _, _ = make_api_result("char/contract_items.xml")
     result = evelink_c.parse_contract_items(api_result)
     self.assertEqual(result, [
         {
             'id': 779703190,
             'quantity': 490,
             'type_id': 17867,
             'action': 'offered',
             'singleton': False
         },
         {
             'id': 779703191,
             'quantity': 60,
             'type_id': 17868,
             'action': 'offered',
             'singleton': False
         },
         {
             'id': 779703192,
             'quantity': 8360,
             'type_id': 1228,
             'action': 'offered',
             'singleton': False
         },
         {
             'id': 779703193,
             'quantity': 16617,
             'type_id': 1228,
             'action': 'offered',
             'singleton': False
         },
         {
             'id': 779703194,
             'quantity': 1,
             'type_id': 973,
             'action': 'offered',
             'singleton': True,
             'raw_quantity': -2
         },
     ])
예제 #4
0
 def contract_items(self, contract_id, api_result=None):
     """Lists items that a specified contract contains"""
     return api.APIResult(parse_contract_items(api_result.result), api_result.timestamp, api_result.expires)
예제 #5
0
    def contract_items(self, contract_id):
        """Lists items that a specified contract contains"""
        api_result = self.api.get('corp/ContractItems',
            {'contractID': contract_id})

        return parse_contract_items(api_result)
예제 #6
0
 def contract_items(self, contract_id, api_result=None):
     """Lists items that a specified contract contains"""
     return api.APIResult(parse_contract_items(api_result.result),
                          api_result.timestamp, api_result.expires)
예제 #7
0
파일: corp.py 프로젝트: dinoboff/evelink
    def contract_items(self, contract_id, api_result=None):
        """Lists items that a specified contract contains"""
        if api_result is None:
            api_result = self.api.get('corp/ContractItems', {'contractID': contract_id})

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