Example #1
0
    def test_parse_market_orders(self):
        api_result, _, _ = make_api_result("char/orders.xml")

        result = evelink_o.parse_market_orders(api_result)

        self.assertEqual(
            result, {
                2579890411: {
                    'account_key': 1000,
                    'char_id': 91397530,
                    'duration': 90,
                    'amount': 2120,
                    'escrow': 0.0,
                    'id': 2579890411,
                    'type': 'sell',
                    'timestamp': 1340742712,
                    'price': 5100.0,
                    'range': 32767,
                    'amount_left': 2120,
                    'status': 'active',
                    'station_id': 60011866,
                    'type_id': 3689
                },
                2584848036: {
                    'account_key': 1000,
                    'char_id': 91397530,
                    'duration': 90,
                    'amount': 1,
                    'escrow': 0.0,
                    'id': 2584848036,
                    'type': 'sell',
                    'timestamp': 1341183080,
                    'price': 250000.0,
                    'range': 32767,
                    'amount_left': 1,
                    'status': 'active',
                    'station_id': 60012550,
                    'type_id': 16399
                }
            })
Example #2
0
    def test_parse_market_orders(self):
        api_result, _, _ = make_api_result("char/orders.xml")

        result = evelink_o.parse_market_orders(api_result)

        self.assertEqual(result, {
            2579890411L: {
                'account_key': 1000,
                'char_id': 91397530,
                'duration': 90,
                'amount': 2120,
                'escrow': 0.0,
                'id': 2579890411L,
                'type': 'sell',
                'timestamp': 1340742712,
                'price': 5100.0,
                'range': 32767,
                'amount_left': 2120,
                'status': 'active',
                'station_id': 60011866,
                'type_id': 3689},
            2584848036L: {
                'account_key': 1000,
                'char_id': 91397530,
                'duration': 90,
                'amount': 1,
                'escrow': 0.0,
                'id': 2584848036L,
                'type': 'sell',
                'timestamp': 1341183080,
                'price': 250000.0,
                'range': 32767,
                'amount_left': 1,
                'status': 'active',
                'station_id': 60012550,
                'type_id': 16399}
            })
 def orders(self, api_result=None):
     """Return a given character's buy and sell orders."""
     return api.APIResult(parse_market_orders(api_result.result), api_result.timestamp, api_result.expires)
Example #4
0
    def orders(self):
        """Return a corporation's buy and sell orders."""
        api_result = self.api.get('corp/MarketOrders')

        return parse_market_orders(api_result)
Example #5
0
File: char.py Project: elly/evelink
    def orders(self):
        """Return a given character's buy and sell orders."""
        api_result = self.api.get('char/MarketOrders',
            {'characterID': self.char_id})

        return parse_market_orders(api_result)
Example #6
0
 def orders(self, api_result=None):
     """Return a corporation's buy and sell orders."""
     return api.APIResult(parse_market_orders(api_result.result), api_result.timestamp, api_result.expires)
Example #7
0
 def orders(self, api_result=None):
     """Return a corporation's buy and sell orders."""
     return api.APIResult(parse_market_orders(api_result.result),
                          api_result.timestamp, api_result.expires)
Example #8
0
 def orders(self, api_result=None):
     """Return a given character's buy and sell orders."""
     return api.APIResult(parse_market_orders(api_result.result),
                          api_result.timestamp, api_result.expires)
Example #9
0
    def orders(self, api_result=None):
        """Return a corporation's buy and sell orders."""
        if api_result is None:
            api_result = self.api.get('corp/MarketOrders')

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