Example #1
0
    def stest_compute(self):
        self.elite.commodities = assets.commodities("commodities.json")

        data = {}
        data['cargohold'] = 100
        data['landingpad'] = "L"
        data['jumprange'] = 13
        data['maxhops'] = 5

        step0 = {}
        step0[u'systemId'] = "Eravate"
        step0["stationId"] = "Russell Ring"
        data[u'route'] = []
        data[u'route'].append(step0)

        result = self.elite.compute(data)

        self.assertEqual(result, "hi")
Example #2
0
 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")
Example #3
0
        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"
Example #4
0
	def test_assets_commodities(self):
		commodities = assets.commodities("res/commodities.json")
		self.assertEqual(len(commodities), 355)