def test_tables_to_keep_wildcard(self): """Test tables using wildcards.""" job = base_job.Job( os.path.join(os.getcwd(), 'sql_server_include_exclude.json')) job.connect_to_database() self.assertEqual([u'STATES_TABLE', u'STATES', u'CITIES', u'RIVERS'], sql_worker.get_tables(job))
def test_tables_to_keep_wildcard(self): """Test tables using wildcards.""" job = base_job.Job( os.path.join(os.getcwd(), 'tables_wildcards_oracle.json')) job.connect_to_database() self.assertEqual(['RUNWAYA', 'RUNWAYL'], sorted(oracle_worker.get_tables(job)))
def test_all_tables(self): """Test all tables are returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'all_tables_oracle.json')) job.connect_to_database() base_tables_to_keep = [ 'AEROFACA', 'AEROFACP', 'AGRISTRA', 'AGRISTRP', 'AQUEDCTA', 'AQUEDCTL', 'AQUEDCTP', 'BARRIERL', 'BLUFFL', 'BRIDGEA', 'BRIDGEL', 'BUILDA', 'BUILDP', 'BUILTUPA', 'BUILTUPP', 'CISTERNP', 'COASTA', 'COASTL', 'COASTP', 'COMMA', 'COMMP', 'CROPA', 'DAMA', 'DAML', 'DAMP', 'DANGERA', 'DANGERL', 'DANGERP', 'DISPOSEA', 'EMBANKA', 'EMBANKL', 'EXTRACTA', 'EXTRACTP', 'FERRYL', 'FERRYP', 'FIREBRKA', 'FORDL', 'FORDP', 'FORTA', 'FORTP', 'GRASSA', 'GROUNDA', 'HARBORA', 'HARBORP', 'INDL', 'INUNDA', 'LAKERESA', 'LANDFRM1A', 'LANDFRM2A', 'LANDFRMA', 'LANDFRML', 'LANDFRMP', 'LANDICEA', 'LANDMRKA', 'LANDMRKL', 'LANDMRKP', 'LOCKA', 'LOCKL', 'LOCKP', 'MARKERSP', 'MILA', 'MILL', 'MILP', 'MISCAEROP', 'MISCL', 'MISCP', 'MISCPOPA', 'MISCPOPP', 'MTNP', 'NUCLEARA', 'OASISA', 'OBSTRP', 'PHYSA', 'PIERA', 'PIERL', 'PIPEL', 'PLAZAA', 'POWERA', 'POWERL', 'POWERP', 'PROCESSA', 'PROCESSP', 'PUMPINGA', 'PUMPINGP', 'RAILRDL', 'RAMPA', 'ROADL', 'RAPIDSA', 'RAPIDSL', 'RAPIDSP', 'RIGWELLP', 'ROADL_1', 'RRTURNP', 'RRYARDA', 'RUINSA', 'RUNWAYA', 'RUNWAYL', 'RUNWAYP', 'SEASTRTA', 'SEASTRTL', 'SHEDL', 'SHEDP', 'SPORTA', 'STORAGEA', 'STORAGEP', 'SUBSTATA', 'SUBSTATP', 'SWAMPA', 'TELEL', 'TESTA', 'TEXTP', 'THERMALA', 'THERMALP', 'TOWERP', 'TRACKL', 'TRAILL', 'TRANSA', 'TRANSL', 'TRANSP', 'TREATA', 'TREATP', 'TREESA', 'TREESL', 'TREESP', 'TUNDRAA', 'TUNNELA', 'TUNNELL', 'UTILP', 'VOIDA', 'WATRCRSA', 'WATRCRSL', 'WELLSPRP' ] self.assertEqual(base_tables_to_keep, oracle_worker.get_tables(job))
def test_all_collections(self): """Test all collections are returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'mongodb_all.json')) job.connect_to_database() base_collections_to_keep = ['zips', 'fs.chunks', 'fs.files'] self.assertEqual(base_collections_to_keep, mongodb_worker.get_collections(job))
def test_collections_to_keep_wildcard(self): """Test collections using wildcards.""" job = base_job.Job( os.path.join(os.getcwd(), 'mongodb_include_exclude.json')) job.connect_to_database() self.assertEqual(['fs.chunks', 'fs.files'], mongodb_worker.get_collections(job))
def test_all_tables(self): """Test all tables are returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'sql_server_all.json')) job.connect_to_database() base_tables_to_keep = [ u'STATES_TABLE', u'STATES', u'CITIES', u'RIVERS', u'CITIESHI' ] self.assertEqual(base_tables_to_keep, sql_worker.get_tables(job))
def test_one_table(self): """Test one table is returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'one_table_oracle.json')) job.connect_to_database() base_table = ['RUNWAYL'] self.assertEqual(base_table, oracle_worker.get_tables(job))
def test_one_table(self): """Test one table is returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'sql_server_one.json')) job.connect_to_database() self.assertEqual(['STATES'], sql_worker.get_tables(job))
def test_one_collection(self): """Test one collection is returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'mongodb_one.json')) job.connect_to_database() self.assertEqual(['zips'], mongodb_worker.get_collections(job))
worker_info['workers'].append({ 'name': worker, 'available': True }) except ImportError as ie: worker_info['workers'].append({ 'name': worker, 'available': False, 'warning': str(ie) }) pass sys.stdout.write(json.dumps(worker_info, indent=2)) sys.stdout.flush() else: from workers import base_job job = base_job.Job(sys.argv[1]) if job.path or job.service_connection: from workers import esri_worker esri_worker.run_job(job) elif job.url: from workers import gdal_worker gdal_worker.run_job(job.job_file) elif job.dynamodb_region: from workers import dynamodb_worker dynamodb_worker.run_job(job) elif job.mongodb_client_info: from workers import mongodb_worker mongodb_worker.run_job(job) elif job.sql_connection_info: if job.sql_driver == 'SQL Server': from workers import sql_worker
def test_layers_to_keep_wildcard(self): """Test layers using wildcards.""" job = base_job.Job(os.path.join(os.getcwd(), 'layers_wildcards_oracle.json')) job.connect_to_database() self.assertEqual([(u'LOCK_A', u'GDB1'), (u'LOCK_L', u'GDB1')], sorted(oracle_worker.get_layers(job)))
def test_one_layer(self): """Test one layer is returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'one_layer_oracle.json')) job.connect_to_database() self.assertEqual([(u'COUNTRY', u'GDB1')], oracle_worker.get_layers(job))
def test_all_layers(self): """Test all layers are returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'all_layers_oracle.json')) job.connect_to_database() base_layers_to_keep = 490 self.assertEqual(base_layers_to_keep, len(oracle_worker.get_layers(job)))
def test_tables_to_keep_wildcard(self): """Test tables using wildcards.""" job = base_job.Job(os.path.join(os.getcwd(), 'my_sql_include_exclude.json')) job.connect_to_database() self.assertEqual(['cities', 'states'], mysql_worker.get_tables(job))
def test_all_tables(self): """Test all tables are returned for indexing.""" job = base_job.Job(os.path.join(os.getcwd(), 'my_sql_all.json')) job.connect_to_database() base_tables_to_keep = ['books', 'cities', 'states'] self.assertEqual(base_tables_to_keep, mysql_worker.get_tables(job))