def getData(prices): if prices['data'] and len(prices['data'])>1: return prices['data'] store = storage.getStorage(config.PricingStorage) return store.load(prices['path'])
def getData(prices): if prices['data'] and len(prices['data']) > 1: return prices['data'] store = storage.getStorage(config.PricingStorage) return store.load(prices['path'])
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)
def __init__(self): self.storage = storage.getStorage(config.AnalyticsStorage) self.cachedApplications = {}