Пример #1
0
 def planetary_pins(self, planet_id, api_result=None):
     """Get a list of PI facilities for a character's planet."""
     return api.APIResult(parse_planetary_pins(api_result.result), api_result.timestamp, api_result.expires)
    def test_parse_planetary_pins(self):
        api_result, _, _ = make_api_result("char/planetary_pins.xml")
        result = evelink_pi.parse_planetary_pins(api_result)
        self.assertEqual(result, {
            1014990260630: {'id': 1014990260630,
                            'type': {'id': 2534, 'name': 'Gas Command Center'},
                            'schematic': 0,
                            'last_launch_ts': None,
                            'cycle_time': 0,
                            'quantity_per_cycle': 0,
                            'install_ts': None,
                            'expiry_ts': None,
                            'content': {'type': 0, 'name': '', 'quantity': 0},
                            'loc': {'long': -0.484603382949165,
                                    'lat': -0.484603382949165},
            },
            1014990361645: {'id': 1014990361645,
                            'type': {'id': 3060,
                                     'name': 'Gas Extractor Control Unit',
                            },
                            'schematic': 0,
                            'last_launch_ts': 1402305835,
                            'cycle_time': 15,
                            'quantity_per_cycle': 251,
                            'install_ts': 1402305835,
                            'expiry_ts': 1402392235,
                            'content': {'type': 0, 'name': '', 'quantity': 0},
                            'loc': {'long': -0.461767301597,
                                    'lat': -0.461767301597},
            },
            1014990361650: {'id': 1014990361650,
                            'type': {'id': 2494,
                                     'name': 'Gas Advanced Industry Facility',
                            },
                            'schematic': 69,
                            'last_launch_ts': 1402305835,
                            'cycle_time': 0,
                            'quantity_per_cycle': 0,
                            'install_ts': None,
                            'expiry_ts': None,
                            'content': {'type': 0, 'name': '', 'quantity': 0},
                            'loc': {'long': -0.518403815307,
                                    'lat': -0.518403815307},
            },
            1014990361651: {'id': 1014990361651,
                            'type': {'id': 2543, 'name': 'Gas Launchpad'},
                            'schematic': 0,
                            'last_launch_ts': None,
                            'cycle_time': 0,
                            'quantity_per_cycle': 0,
                            'install_ts': None,
                            'expiry_ts': None,
                            'content': {'type': 0, 'name': '', 'quantity': 0},
                            'loc': {'long': -0.544793681671,
                                    'lat': -0.544793681671},
            },
            1014990361652: {'id': 1014990361652,
                            'type': {'id': 2536, 'name': 'Gas Storage Facility'},
                            'schematic': 0,
                            'last_launch_ts': None,
                            'cycle_time': 0,
                            'quantity_per_cycle': 0,
                            'install_ts': None,
                            'expiry_ts': None,
                            'content': {'type': 0, 'name': '', 'quantity': 0},
                            'loc': {'long': -0.470709152144,
                                    'lat': -0.470709152144},
            },

        })
Пример #3
0
 def planetary_pins(self, planet_id, api_result=None):
     """Get a list of PI facilities for a character's planet."""
     return api.APIResult(parse_planetary_pins(api_result.result),
                          api_result.timestamp, api_result.expires)
Пример #4
0
 def test_parse_planetary_pins(self):
     api_result, _, _ = make_api_result("char/planetary_pins.xml")
     result = evelink_pi.parse_planetary_pins(api_result)
     self.assertEqual(result, {
         1018352222277: {'contents': {},
                         'content': {'type': 0, 'name': '', 'quantity': 0,
                                     'deprecated': 'Use the "contents" field instead'},
                         'cycle_time': 0,
                         'expiry_ts': None,
                         'id': 1018352222277,
                         'install_ts': None,
                         'last_launch_ts': None,
                         'loc': {'lat': 2.30568628105134, 'long': -6.0348096042028},
                         'quantity_per_cycle': 0,
                         'schematic': 0,
                         'type': {'id': 2254, 'name': 'Temperate Command Center'}},
         1018352251143: {'contents': {},
                         'content': {'type': 0, 'name': '', 'quantity': 0,
                                     'deprecated': 'Use the "contents" field instead'},
                         'cycle_time': 30,
                         'expiry_ts': 1433483274,
                         'id': 1018352251143,
                         'install_ts': 1433305074,
                         'last_launch_ts': 1433308674,
                         'loc': {'lat': 2.27884848837, 'long': -5.97671090064},
                         'quantity_per_cycle': 6065,
                         'schematic': 0,
                         'type': {'id': 3068,
                                     'name': 'Temperate Extractor Control Unit'}},
         1018352251145: {'contents': {2268: {'name': 'Aqueous Liquids',
                                             'quantity': 3000,
                                             'type': 2268}},
                         'content': {'name': 'Aqueous Liquids',
                                     'quantity': 3000,
                                     'type': 2268,
                                     'deprecated': 'Use the "contents" field instead'},
                         'cycle_time': 0,
                         'expiry_ts': None,
                         'id': 1018352251145,
                         'install_ts': None,
                         'last_launch_ts': 1433307646,
                         'loc': {'lat': 2.21945171231, 'long': -6.05437394311},
                         'quantity_per_cycle': 0,
                         'schematic': 121,
                         'type': {'id': 2481,
                                     'name': 'Temperate Basic Industry Facility'}},
         1018352251149: {'contents': {2397: {'name': 'Industrial Fibers',
                                             'quantity': 40,
                                             'type': 2397}},
                         'content': {'name': 'Industrial Fibers',
                                     'quantity': 40,
                                     'type': 2397,
                                     'deprecated': 'Use the "contents" field instead'},
                         'cycle_time': 0,
                         'expiry_ts': None,
                         'id': 1018352251149,
                         'install_ts': None,
                         'last_launch_ts': 1433308866,
                         'loc': {'lat': 2.23960260135, 'long': -6.0353691422},
                         'quantity_per_cycle': 0,
                         'schematic': 80,
                         'type': {'id': 2480,
                                     'name': 'Temperate Advanced Industry Facility'}},
         1018352251151: {'contents': {2305: {'name': 'Autotrophs',
                                             'quantity': 160192,
                                             'type': 2305},
                                      9828: {'name': 'Silicon',
                                             'quantity': 2760,
                                             'type': 9828}},
                         'content': {'name': 'Autotrophs',
                                     'quantity': 160192,
                                     'type': 2305,
                                     'deprecated': 'Use the "contents" field instead'},
                         'cycle_time': 0,
                         'expiry_ts': None,
                         'id': 1018352251151,
                         'install_ts': None,
                         'last_launch_ts': None,
                         'loc': {'lat': 2.2437423448, 'long': -6.02030550651},
                         'quantity_per_cycle': 0,
                         'schematic': 0,
                         'type': {'id': 2256, 'name': 'Temperate Launchpad'}},
         1018352251153: {'contents': {2268: {'name': 'Aqueous Liquids',
                                             'quantity': 388209,
                                             'type': 2268},
                                      2397: {'name': 'Industrial Fibers',
                                             'quantity': 2600,
                                             'type': 2397}},
                         'content': {'name': 'Aqueous Liquids',
                                     'quantity': 388209,
                                     'type': 2268,
                                     'deprecated': 'Use the "contents" field instead'},
                         'cycle_time': 0,
                         'expiry_ts': None,
                         'id': 1018352251153,
                         'install_ts': None,
                         'last_launch_ts': 1433308016,
                         'loc': {'lat': 2.25213553747, 'long': -6.03170333208},
                         'quantity_per_cycle': 0,
                         'schematic': 0,
                         'type': {'id': 2562, 'name': 'Temperate Storage Facility'}}
     })