Exemple #1
0
    def test_get_client_from_params_with_params(self):
        #Act
        client = DropboxConnection.get_client_from_params(
            ['auth_token', remote_dir])

        #Assert
        self.assertIsNotNone(client)
if __name__ == "__main__":
    #Parse commandline arguments
    epoch_data_dirs, dropbox_parameters, log_to_console = parse_args()

    #Initialize logging
    logging.initialize(__file__, log_to_console=log_to_console)
    logger = logging.get_logger(__name__)

    #Log input parameters
    logger.info(
        'Running with parameters epoch_data_dirs: %s log_to_console: %d',
        epoch_data_dirs, log_to_console)

    #Dropbox connection
    dropbox = DropboxConnection.get_client_from_params(dropbox_parameters)

    #Prepare input files
    input_files_client = InputFiles(dropbox)

    #Epoch data files placeholder
    input_files = []

    ####################################### Prepare input files [Start] ############################################
    #Iterate over input epoch stores and enumerate their result files.
    for epoch_store in epoch_data_dirs:
        #Fetch the remote epoch data
        epoch_data = dropbox.list(epoch_store,
                                  constants.INPUT_RESULT_FILE_PREFIX)

        #Extract file paths from epoch data
Exemple #3
0
    def test_get_client_from_params_no_params(self):
        #Act
        client = DropboxConnection.get_client_from_params(None)

        #Assert
        self.assertIsNone(client)