예제 #1
0
def test_basic():
    res = integr.parse('1,3,5,9')
    assert res == [1, 3, 5, 9]
예제 #2
0
def test_basic():
    istring = "1,2,3,4,5"
    res = parse(istring)
    assert res == [1, 2, 3, 4, 5]
예제 #3
0
def test_bad1():
    with pytest.raises(ValueError):
        integr.parse('bad_input')
예제 #4
0
def test_bad2():
    res = integr.parse('1-3,12-15')
예제 #5
0
def test_basic():
    data = '1,3,5,9'
    res = parse(data)
    print(f'Res {res}')
    assert res == [0, 3, 5, 9]
예제 #6
0
def test_basic():
    #import pdb;pdb.set_trace()
    result = parse("1,3,5,9")
    assert [1, 3, 5, 9] == result, "expect [1,3,5,9]"
예제 #7
0
def test_exc2():
    parse('1,a,3,5,6')
예제 #8
0
 def test_bad2(self):
     try:
         integr.parse('abcd')
         self.fail('Parsed bad input')
     except BadInput:
         pass
예제 #9
0
 def test_bad3(self):
     with self.assertRaises(BadInput):
         integr.parse('abcd')
예제 #10
0
def test_exc():
    with pytest.raises(ValueError):
        parse('1,a,3,5,6')
예제 #11
0
 def test_bad2(self):
     try:
         integr.parse('abcd')
         self.fail('Parsed bad input')
     except BadInput:
         pass
예제 #12
0
 def test_spaces(self):
     results = integr.parse('1, 3, 4')
     self.assertEquals(results, [1,3,4])
예제 #13
0
 def test_basic(self):
     # any method beginning with "test" is a test
     results = integr.parse('1,3,4')
     self.assertEquals(results, [1,3,4])
예제 #14
0
 def test_basic(self):
     # any method beginning with "test" is a test
     results = integr.parse('1,3,4')
     self.assertEquals(results, [1, 3, 4])
예제 #15
0
def test_bad1():
    with pytest.raises(ValueError):
        parse('1-3,12-15')
예제 #16
0
 def test_spaces(self):
     results = integr.parse('1, 3, 4')
     self.assertEquals(results, [1, 3, 4])
예제 #17
0
def test_bad2():
    parse('1-3,12-15')
예제 #18
0
 def test_bad3(self):
     with self.assertRaises(BadInput):
         integr.parse('abcd')
예제 #19
0
def test_bad1():
    with pytest.raises(ValueError):
        parse('bad input')