示例#1
0
    def test_status_watch(self):

        args = getOpts(['status', '--watch'])

        print(args)
        '''
        {'--watch': True,
         '-w': False,
         'status': True}
        '''

        self.assertKeyValue(args, 'status', True)
        self.assertTrue(hasWatch(args))

        self.assertTrue(hasWatch(getOpts(['status', '--watch'])))
        self.assertTrue(hasWatch(getOpts(['status', '-w'])))

        self.assertFalse(hasWatch(getOpts(['status'])))
示例#2
0
    def test_run(self):

        args = getOpts(['run', 'sites.yaml'])

        print(args)
        '''
         '<runSpec>': 'sites.yaml',
         'run': True,
        '''

        self.assertKeyValue(args, 'run', True)
        self.assertKeyValue(args, '<runSpec>', 'sites.yaml')
示例#3
0
    def test_status(self):

        args = getOpts(['status'])

        print(args)
        '''
        {'<runSpec>': None,
         'run': False,
         'status': True}
        '''

        self.assertKeyValue(args, 'status', True)
示例#4
0
    def test_ls(self):

        args = getOpts(['get', 'https://tes.tsi.ebi.ac.uk/data/tmp/'])

        print(args)
        '''
        'get': True,
        '<url>': 'https://tes.tsi.ebi.ac.uk/data/tmp/',
        '''

        self.assertKeyValue(args, 'get', True)
        self.assertKeyValue(args, '<url>',
                            'https://tes.tsi.ebi.ac.uk/data/tmp/')
示例#5
0
文件: Main.py 项目: Zcowyzrg/WesCli
def _main(args):

    opts = getOpts(args)

    #     print(opts)

    if opts['run']: run_multiple(opts['<runSpec>'])
    elif opts['get']: getCmd(opts['<url>'])
    elif opts['upload']: upload(opts['<url>'], opts['<filename>'])

    elif opts['status']:

        if hasWatch(opts): os.system('watch -n 1 -d wes status')
        else: status_multiple()