Beispiel #1
0
def test_basic():
    res = integr.parse('1,3,5,9')
    assert res == [1, 3, 5, 9]
Beispiel #2
0
def test_basic():
    istring = "1,2,3,4,5"
    res = parse(istring)
    assert res == [1, 2, 3, 4, 5]
Beispiel #3
0
def test_bad1():
    with pytest.raises(ValueError):
        integr.parse('bad_input')
Beispiel #4
0
def test_bad2():
    res = integr.parse('1-3,12-15')
Beispiel #5
0
def test_basic():
    data = '1,3,5,9'
    res = parse(data)
    print(f'Res {res}')
    assert res == [0, 3, 5, 9]
Beispiel #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]"
Beispiel #7
0
def test_exc2():
    parse('1,a,3,5,6')
Beispiel #8
0
 def test_bad2(self):
     try:
         integr.parse('abcd')
         self.fail('Parsed bad input')
     except BadInput:
         pass
Beispiel #9
0
 def test_bad3(self):
     with self.assertRaises(BadInput):
         integr.parse('abcd')
Beispiel #10
0
def test_exc():
    with pytest.raises(ValueError):
        parse('1,a,3,5,6')
Beispiel #11
0
 def test_bad2(self):
     try:
         integr.parse('abcd')
         self.fail('Parsed bad input')
     except BadInput:
         pass
Beispiel #12
0
 def test_spaces(self):
     results = integr.parse('1, 3, 4')
     self.assertEquals(results, [1,3,4])
Beispiel #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])
Beispiel #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])
Beispiel #15
0
def test_bad1():
    with pytest.raises(ValueError):
        parse('1-3,12-15')
Beispiel #16
0
 def test_spaces(self):
     results = integr.parse('1, 3, 4')
     self.assertEquals(results, [1, 3, 4])
Beispiel #17
0
def test_bad2():
    parse('1-3,12-15')
Beispiel #18
0
 def test_bad3(self):
     with self.assertRaises(BadInput):
         integr.parse('abcd')
Beispiel #19
0
def test_bad1():
    with pytest.raises(ValueError):
        parse('bad input')