def get_dummy_datasource(cursor, name): ds = get_datasource(cursor, name) if ds: return ds else: return add_dummy_datasource(cursor, name)
def get_dummy_datasource(cursor, name): datasource = get_datasource(cursor, name) if not datasource: datasource = create_datasource(cursor, name, "Dummy source for integration test", TIMEZONE, "trend") return datasource
def get_partition(cursor, datasource_name, entitytype_name, granularity, timestamp): datasource = get_datasource(cursor, datasource_name) entitytype = get_entitytype(cursor, entitytype_name) granularity = create_granularity(granularity) trendstore = TrendStore(datasource, entitytype, granularity) return trendstore.partition(timestamp)