示例#1
0
 def test_complex_case(self):
     self.assertEqual(
         Flag.split_flag_args(
             ['hello', '--foo', '--bar=baz', '--bing', 'world']),
         ({
             u'bing': True,
             u'foo': True,
             u'bar': u'baz'
         }, [u'hello', u'world']))
示例#2
0
def scores(_, *args):
    flags, paths = Flag.split_flag_args(args)
    paths = paths or ['']
    printed = False
    for p in paths:
        printed = _scores(p, **flags) or printed

    if printed:
        LOGGER.info('')
    else:
        LOGGER.info('  No matching scores found.\n')
示例#3
0
 def test_empty(self):
     self.assertEqual(Flag.split_flag(''), (u'', True))
示例#4
0
 def test_complex_case(self):
     self.assertEqual(
       Flag.split_flag_args(
           ['hello', '--foo', '--bar=baz', '--bing', 'world']),
       ({u'bing': True, u'foo': True, u'bar': u'baz'}, [u'hello', u'world']))
示例#5
0
 def test_full_flag(self):
     self.assertEqual(Flag.split_flag('--hello=world'), (u'hello', u'world'))
示例#6
0
 def test_double_dash_equal(self):
     self.assertEqual(Flag.split_flag('--hello='), (u'hello', True))
示例#7
0
 def test_single_flag(self):
     self.assertEqual(Flag.split_flag('-x'), (u'x', True))
示例#8
0
 def test_single_dash(self):
     self.assertEqual(Flag.split_flag('-'), (u'', True))
示例#9
0
 def test_empty(self):
     self.assertEqual(Flag.split_flag(''), (u'', True))
示例#10
0
 def test_full_flag(self):
     self.assertEqual(Flag.split_flag('--hello=world'),
                      (u'hello', u'world'))
示例#11
0
 def test_double_dash_equal(self):
     self.assertEqual(Flag.split_flag('--hello='), (u'hello', True))
示例#12
0
 def test_single_flag(self):
     self.assertEqual(Flag.split_flag('-x'), (u'x', True))
示例#13
0
 def test_single_dash(self):
     self.assertEqual(Flag.split_flag('-'), (u'', True))