예제 #1
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_comma(self):
     t = cli.slice_type()
     r = t('37,42')
     assert_equal(r, [37, 42])
예제 #2
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_zero_1(self):
     t = cli.slice_type(1)
     r = t('0')
     assert_equal(r, [0])
예제 #3
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_positive_1(self):
     t = cli.slice_type(1)
     r = t('42')
     assert_equal(r, [42])
예제 #4
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_non_int(self):
     t = cli.slice_type()
     with assert_raises(ValueError):
         t('')
     with assert_raises(ValueError):
         t('ham')
예제 #5
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_negative(self):
     t = cli.slice_type()
     with assert_raises(ValueError):
         t('-42')
예제 #6
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_plus_lt(self):
     t = cli.slice_type()
     with assert_raises(ValueError):
         t('42+-5')
예제 #7
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def t(inp, exp):
     t = cli.slice_type()
     r = cli.get_slice_repr(inp)
     assert_equal(r, exp)
     assert_equal(t(r), inp)
예제 #8
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_plus_eq(self):
     t = cli.slice_type()
     with assert_raises(ValueError):
         t('37+0')
예제 #9
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_plus_1(self):
     t = cli.slice_type(1)
     with assert_raises(ValueError):
         t('37+5')
예제 #10
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_plus(self):
     t = cli.slice_type()
     r = t('37+5')
     assert_equal(r, [37, 42])
예제 #11
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_comma_lt(self):
     t = cli.slice_type()
     with assert_raises(ValueError):
         t('42,37')
예제 #12
0
파일: test_cli.py 프로젝트: nideri/didjvu
 def test_comma_1(self):
     t = cli.slice_type(1)
     with assert_raises(ValueError):
         t('37,42')