示例#1
0
    def test_read_rest_3 (self) :
        r = StringIO.StringIO("1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 \n")
        a = []
        b = pfd_read_rest(r, a)
        self.assert_(b == True)
	i = 0
	while i < 102 :
            self.assert_(a[i] == 1)
	    i += 1
示例#2
0
    def test_read_rest_1 (self) :
        r = StringIO.StringIO("1 10 20 30 40\n")
        a = []
        b = pfd_read_rest(r, a)
        self.assert_(b == True)
        self.assert_(a[0] ==  1)
        self.assert_(a[1] == 10)
	self.assert_(a[2] == 20)
	self.assert_(a[3] == 30)
	self.assert_(a[4] == 40)
示例#3
0
 def test_read_rest_2 (self) :
     r = StringIO.StringIO("")
     a = []
     b = pfd_read_rest(r, a)
     self.assert_(b == False)
     self.assert_(len(a) == 0)