Esempio n. 1
0
	def getData(prices):
		if prices['data'] and len(prices['data'])>1:
			return prices['data']

		store = storage.getStorage(config.PricingStorage)

		return store.load(prices['path'])
Esempio n. 2
0
    def getData(prices):
        if prices['data'] and len(prices['data']) > 1:
            return prices['data']

        store = storage.getStorage(config.PricingStorage)

        return store.load(prices['path'])
Esempio n. 3
0
	def testPath(self):
		backend = content.Content()
		a = backend.addApplication('Test')
		
		data = """
			sword, 1000
			saber, 2000
			knife, 500
		"""	

		fileStorage = storage.getStorage(config.PricingStorage)
		fileStorage.save('test.csv', data)

		csvPrices = backend.addPrices(a.key, 'CSV', None, 'test.csv')

		backend.setABTest(a.key, {'groupAPrices_key': csvPrices.key})
		backend.setABTest(a.key, {'groupBPrices_key': csvPrices.key})
		
		p = pricing.PricingEngine.getApplicationPricing(a.key)

		self.assertNotEqual(p.groupAPrices, None)
		self.assertNotEqual(p.groupBPrices, None)

		prices = p.getPrices('1'*32, [None]*32)
Esempio n. 4
0
 def __init__(self):
     self.storage = storage.getStorage(config.AnalyticsStorage)
     self.cachedApplications = {}
Esempio n. 5
0
	def __init__(self):
		self.storage = storage.getStorage(config.AnalyticsStorage)
		self.cachedApplications = {}