Ejemplo n.º 1
0
 def test_parse_int_list(self):
   eq_(parse_arg({'foo': '1,'}, 'foo', int, ','), [1])
   eq_(parse_arg({'foo': '1,2'}, 'foo', int, ','), [1,2])
Ejemplo n.º 2
0
 def test_parse_int(self):
   eq_(parse_arg({'foo': '1'}, 'foo', int), 1)
   eq_(parse_arg({'foo': '1'}, 'foo', int, ','), 1)
Ejemplo n.º 3
0
 def test_parse_float(self):
   eq_(parse_arg({'foo': '123.4'}, 'foo', float), 123.4)
Ejemplo n.º 4
0
 def test_parse_invalid(self):
   parse_arg({'foo': 'a'}, 'foo', int)
Ejemplo n.º 5
0
 def test_parse_int_list(self):
     eq_(parse_arg({'foo': '1,'}, 'foo', int, ','), [1])
     eq_(parse_arg({'foo': '1,2'}, 'foo', int, ','), [1, 2])
Ejemplo n.º 6
0
 def test_parse_float(self):
     eq_(parse_arg({'foo': '123.4'}, 'foo', float), 123.4)
Ejemplo n.º 7
0
 def test_parse_int(self):
     eq_(parse_arg({'foo': '1'}, 'foo', int), 1)
     eq_(parse_arg({'foo': '1'}, 'foo', int, ','), 1)
Ejemplo n.º 8
0
 def test_parse_invalid(self):
     parse_arg({'foo': 'a'}, 'foo', int)