def setUp(self): self.mox = mox.Mox() test_util.SetConfigPaths() data_source_config.CONFIG_FILE = (os.path.join( test_util.GetRootPath(), DataSourceConfigTest.MOCK_CONFIG_FILE))
def setUp(self): client.DATASET_ID = 'samples_mart_testdata' test_util.SetConfigPaths() self.data_client = test_util.GetDataClient(mocked=True) self.data_client.mock_reply = {'totalRows': 0, 'jobReference': 0, 'schema': {'fields': []}}
def setUp(self): self.mox = mox.Mox() test_util.SetConfigPaths() self.client = big_query_client.BigQueryClient( credentials_lib.DEFAULT_CREDENTIALS, data_source_config.Environments.TESTING) self.temp_tables = set()
def setUp(self): super(PagesTest, self).setUp() self.app = webtest.TestApp(pages.app) test_util.SetConfigPaths() self.testbed = testbed.Testbed() self.testbed.activate() self.testbed.init_datastore_v3_stub() self.testbed.init_memcache_stub()
def setUp(self): super(DataTest, self).setUp() data.DATASET_NAME = 'samples_mart_mockdata' base.DEFAULT_ENVIRONMENT = config.Environments.TESTING self.app = webtest.TestApp(data.app) test_util.SetConfigPaths() # Rewrite the DataHandlerUtil methods to return local clients. data.DataHandlerUtil.GetDataClient = self._GetTestDataClient
def setUp(self): super(DataTest, self).setUp() data.DATASET_NAME = 'samples_mart_mockdata' base.DEFAULT_ENVIRONMENT = config.Environments.TESTING self.maxDiff = None self.app = webtest.TestApp(data.app) self.testbed = testbed.Testbed() self.testbed.activate() self.testbed.init_datastore_v3_stub() self.testbed.init_memcache_stub() self.VALID_SQL = ('SELECT\n' '\tproduct_name,\n' '\ttest,\n' '\tAVG(value) AS avg,\n' 'FROM [samples_mart_testdata.results]\n' 'WHERE\n' '\ttimestamp >= 1356739200 AND\n' '\ttimestamp < 1356825600\n' 'GROUP BY\n' '\tproduct_name,\n' '\ttest') self.VALID_DASHBOARD = { 'children': [{ 'container': { 'children': [{ 'id': '1' }, { 'id': '2' }] } }, { 'container': { 'children': [{ 'id': '3', 'datasource': { 'query': self.VALID_SQL } }, { 'id': '4' }] } }] } self.VALID_RESULTS = { 'cols': [{ 'id': 'product_name', 'label': 'product_name', 'type': 'string' }, { 'id': 'test', 'label': 'test', 'type': 'string' }, { 'id': 'avg', 'label': 'avg', 'type': 'number' }], 'rows': [{ 'c': [{ 'v': 'widget-factory' }, { 'v': 'create-widgets' }, { 'v': 6.872222222222222 }] }] } test_util.SetConfigPaths() # Rewrite the DataHandlerUtil methods to return local clients. data.DataHandlerUtil.GetDataClient = self._GetTestDataClient self.explorer_config = explorer_config.ExplorerConfigModel.Get() self.explorer_config.default_project = config.Services.GetServiceUri( config.Environments.TESTING, config.Services.PROJECT_ID) self.explorer_config.grant_view_to_public = True self.explorer_config.put()
def setUp(self): test_util.SetConfigPaths()
def setUp(self): test_util.SetConfigPaths() self._setUpConstants()