def test_command_sync():
    """Test the sync fuction.

    Since this function only passes argparse arguments for the sync subcommand
    straight to `synapseutils.sync.syncToSynapse`, the only tests here are for
    the command line arguments provided and that the function is called once.

    """

    parser = cmdline.build_parser()
    args = parser.parse_args(['sync', '/tmp/foobarbaz.tsv'])

    assert_equals(args.manifestFile, '/tmp/foobarbaz.tsv')
    assert_equals(args.dryRun, False)
    assert_equals(args.sendMessages, False)
    assert_equals(args.retries, 4)

    with patch.object(synapseutils, "syncToSynapse") as mockedSyncToSynapse:
        cmdline.sync(args, syn)
        mockedSyncToSynapse.assert_called_once_with(
            syn,
            manifestFile=args.manifestFile,
            dryRun=args.dryRun,
            sendMessages=args.sendMessages,
            retries=args.retries)
def setup_module(module):
    print '\n'
    print '~' * 60
    print os.path.basename(__file__)
    print '~' * 60
    module.syn = integration.syn
    module.parser = cmdline.build_parser()
def setup_module(module):
    print('\n')
    print('~' * 60)
    print(os.path.basename(__file__))
    print('~' * 60)
    module.syn = integration.syn
    module.parser = cmdline.build_parser()
Exemplo n.º 4
0
def setup_module(module):
    print '\n'
    print '~' * 60
    print os.path.basename(__file__)
    print '~' * 60
    module.syn = integration.syn
    module.parser = cmdline.build_parser()
def setup_module(module):
    print('\n')
    print('~' * 60)
    print(os.path.basename(__file__))
    print('~' * 60)
    module.syn = integration.syn
    module.parser = cmdline.build_parser()
Exemplo n.º 6
0
 def __init__(self):
     self.syn = syn
     self.project = project
     self.schedule_for_cleanup = schedule_for_cleanup
     self.parser = cmdline.build_parser()
     self.upload_filename = _create_temp_file_with_cleanup(schedule_for_cleanup)
     self.description_text = "'some description text'"
     self.desc_filename = _create_temp_file_with_cleanup(schedule_for_cleanup, self.description_text)
     self.update_description_text = \
         "'SOMEBODY ONCE TOLD ME THE WORLD WAS GONNA ROLL ME I AINT THE SHARPEST TOOL IN THE SHED'"
def setup_module(module):

    module.syn = integration.syn
    module.project = integration.project

    module.parser = cmdline.build_parser()

    # used for --description and --descriptionFile tests
    module.upload_filename = _create_temp_file_with_cleanup()
    module.description_text = "'some description text'"
    module.desc_filename = _create_temp_file_with_cleanup(module.description_text)
    module.update_description_text = \
        "'SOMEBODY ONCE TOLD ME THE WORLD WAS GONNA ROLL ME I AINT THE SHARPEST TOOL IN THE SHED'"
Exemplo n.º 8
0
def setup_module(module):

    module.syn = integration.syn
    module.project = integration.project

    module.parser = cmdline.build_parser()

    # used for --description and --descriptionFile tests
    module.upload_filename = _create_temp_file_with_cleanup()
    module.description_text = "'some description text'"
    module.desc_filename = _create_temp_file_with_cleanup(module.description_text)
    module.update_description_text = \
        "'SOMEBODY ONCE TOLD ME THE WORLD WAS GONNA ROLL ME I AINT THE SHARPEST TOOL IN THE SHED'"
Exemplo n.º 9
0
def test_get_multi_threaded_flag():
    """Test the sync function.

    Since this function only passes argparse arguments for the sync subcommand
    straight to `synapseutils.sync.syncToSynapse`, the only tests here are for
    the command line arguments provided and that the function is called once.

    """

    parser = cmdline.build_parser()
    args = parser.parse_args(['get', '--multiThreaded', 'syn123'])

    assert_true(args.multiThreaded)

    args = parser.parse_args(['get', 'syn123'])
    assert_false(args.multiThreaded)
def test_command_sync():
    """Test the sync fuction.

    Since this function only passes argparse arguments for the sync subcommand
    straight to `synapseutils.sync.syncToSynapse`, the only tests here are for
    the command line arguments provided and that the function is called once.

    """

    parser = cmdline.build_parser()
    args = parser.parse_args(['sync', '/tmp/foobarbaz.tsv'])

    assert_equals(args.manifestFile, '/tmp/foobarbaz.tsv')
    assert_equals(args.dryRun, False)
    assert_equals(args.sendMessages, False)
    assert_equals(args.retries, 4)

    with patch.object(synapseutils, "syncToSynapse") as mockedSyncToSynapse:
        cmdline.sync(args, syn)
        mockedSyncToSynapse.assert_called_once_with(syn,
                                                    manifestFile=args.manifestFile,
                                                    dryRun=args.dryRun,
                                                    sendMessages=args.sendMessages,
                                                    retries=args.retries)