Example #1
0
 def test_get_layers_map(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest get layers in map: Test map from QGISCartoDB 3')
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_get_layers_map_result)
     cartodbApi.getLayersMap(test_map)
Example #2
0
 def test_create_viz_from_table(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest create viz from table. Name: Test map from QGISCartoDB')
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_show_create_viz_result)
     cartodbApi.createVizFromTable('test_ideca_cuerpos_agua', 'Test map from QGISCartoDB', 'Test map from Description')
Example #3
0
 def test_upload_file_status(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest upload file status for shape: constituencies.zip')
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_show_upload_status_result)
     cartodbApi.checkUploadStatus('53dc786b-6013-4e7f-977c-5136f9828494')
Example #4
0
 def test_download_file(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest download table data for: world_borders')
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_download_file)
     cartodbApi.download('SELECT * FROM world_borders LIMIT 10')
Example #5
0
 def test_get_table_data(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest table data for: world_borders')
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_show_table_data)
     cartodbApi.getDataFromTable('SELECT * FROM world_borders LIMIT 10')
Example #6
0
 def test_show_user_tables(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest get user tables for: ' + cartodb_user)
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_show_user_tables)
     cartodbApi.getUserTables()
Example #7
0
 def test_add_layer_to_map(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest add layer to map. Layer: test_ideca_localidades')
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_add_layer_to_map_result)
     cartoCSS = '#test_ideca_localidades { polygon-fill: #7B00B4; polygon-opacity: 0.6; line-color: #0F3B82; line-width: 0.5; line-opacity: 1; }'
     cartodbApi.addLayerToMap(test_map, 'test_ideca_localidades', cartoCSS)
Example #8
0
 def test_upload_file(self):
     self.logger.debug("\n*******************************************************************************")
     self.logger.debug('\nTest upload shape: constituencies.zip')
     self.logger.debug("\n*******************************************************************************")
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(self.signalsObject.cb_show_upload_result)
     cartodbApi.progress.connect(self.signalsObject.cb_progress)
     path = os.path.dirname(os.path.abspath(__file__))
     path = os.path.join(path, upload_file)
     # path = '/home/elesdoar/Documents/QGIS CartoDB/lotes_simplificados.zip'
     cartodbApi.upload(path)
Example #9
0
 def test_upload_file(self):
     self.logger.debug(
         "\n*******************************************************************************"
     )
     self.logger.debug('\nTest upload shape: constituencies.zip')
     self.logger.debug(
         "\n*******************************************************************************"
     )
     cartodbApi = CartoDBApi(cartodb_user, api_key, is_multiuser)
     cartodbApi.fetchContent.connect(
         self.signalsObject.cb_show_upload_result)
     cartodbApi.progress.connect(self.signalsObject.cb_progress)
     path = os.path.dirname(os.path.abspath(__file__))
     path = os.path.join(path, 'data')
     path = os.path.join(path, 'constituencies.zip')
     cartodbApi.upload(path)