def slow_test_create_galaxy_minipickle(self): entities.reset() entities.systems = assets.systems("res/systems_populated.json") entities.stations = assets.systems("res/stations.json") entities.markets = assets.markets("res/listings.csv") eravate = entities.system(name="Eravate") opt = { "ly": 50 } systems = {} for system in galaxy.proximity(system=eravate, options=opt): systems[ system["id"] ] = system self.assertEqual(len(systems), 519) stations = {} for station in galaxy.hubs(system=eravate, options=opt): stations[ station["id"] ] = station self.assertEqual(len(stations), 2081) markets = {} for station in stations.values(): markets[ station["id"] ] = entities.market(station["id"]) self.assertEqual(len(markets), 2081) assets.doPickle(systems, "res/systems-mini-50.pic") assets.doPickle(stations, "res/stations-mini-50.pic") assets.doPickle(markets, "res/markets-mini-50.pic")
def dtest_elite_deals_real(self): self.elite.markets = assets.markets("listings.csv") self.elite.stations = assets.stations("stations.json") self.elite.systems = assets.systems("systems_populated.json") station = self.elite.findStationLike("Russell Ring")[0] marketId = station["id"] system = self.elite.system(id=station["system_id"]) proxies = self.elite.proxies(15, system) self.assertEqual(len(proxies), 77) deals = self.elite.bestdeals(marketId, proxies, 200) self.assertEqual(deals, (596000, [(68, '29', 992, 200), (1265, '24', 1988, 200)]))
def setUp(self): entities.reset() entities.markets = assets.markets("test/test-markets.csv") entities.systems = assets.systems("test/test-systems.json") entities.stations = assets.stations("test/test-stations.json") entities.commodities = assets.commodities("res/commodities.json")
if not len(dealsFrom): instructions.append((target, 0, 0, 0)) profits.sort(key=lambda (profit, instructions): profit, reverse=True) return profits[0] if __name__ == "__main__": print "Start Elite:Dangerous Mission Optimizer" if len(sys.argv) == 1 and sys.argv[1] == "--update": assets.update("res/commodities.json", True) assets.update("res/stations.json") assets.update("res/systems_populated.json") assets.update("res/listings.csv") if len(sys.argv) == 1 or sys.argv[1] != "--maxi": print "Limited Edition" entities.systems = assets.unPickle("res/systems-mini-50.pic") entities.stations = assets.unPickle("res/stations-mini-50.pic") entities.markets = assets.unPickle("res/markets-mini-50.pic") else: entities.stations = assets.stations("stations.json") entities.systems = assets.systems("systems_populated.json") entities.markets = assets.markets("listings.csv") entities.commodities = assets.commodities("res/commodities.json") server().runServer() print "End Elite:D-MO"
def slow_test_assets_markets_big(self): markets = assets.markets("listings.csv") self.assertEqual(len(markets), 53899)
def test_assets_markets(self): markets = assets.markets("test/test-markets.csv") self.assertEqual(len(markets), 4)