Ejemplo n.º 1
0
 def test_print_1(self):
     w = StringIO.StringIO()
     answer = [
         1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 5,
         21, 22, 23, 24, 25, 26, 4
     ]
     pfd_print(w, answer)
     self.assert_(
         w.getvalue() ==
         "1 2 3 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 5 21 22 23 24 25 26 4 \n\n"
     )
Ejemplo n.º 2
0
 def test_print_2(self):
     w = StringIO.StringIO()
     answer = [
         2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22,
         23, 24, 1, 25, 26, 27, 10, 17, 28
     ]
     pfd_print(w, answer)
     self.assert_(
         w.getvalue() ==
         "2 3 4 5 6 7 8 9 11 12 13 14 15 16 18 19 20 21 22 23 24 1 25 26 27 10 17 28 \n\n"
     )
Ejemplo n.º 3
0
    def test_print_3 (self) :
        w = StringIO.StringIO()
        pfd_print(w, [10, 9, 8, 7, 6, 5, 4, 3, 2, 1])
	s = w.getvalue()
	#print(s)
        self.assert_(s == "10 9 8 7 6 5 4 3 2 1 \n")
Ejemplo n.º 4
0
 def test_print_1 (self):
     w = StringIO.StringIO()
     pfd_print(w, ['2', '3', ' ', ' ', 'hello'])
     self.assert_(w.getvalue() == "23  hello")
Ejemplo n.º 5
0
 def test_print_3 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [1])
     self.assert_(w.getvalue() == "1\n\n")
Ejemplo n.º 6
0
 def test_print_1 (self) :
     w = StringIO.StringIO()
     v = [1, 5, 3, 2, 4]
     pfd_print(w, v)
     self.assert_(w.getvalue() == "1 5 3 2 4\n\n")
Ejemplo n.º 7
0
	def test_print_3 (self) :
		w = StringIO.StringIO()
		answer = [1]
		pfd_print(w, answer)
		self.assert_(w.getvalue() == "1 \n\n")
Ejemplo n.º 8
0
	def test_print_1 (self) :
		w = StringIO.StringIO()
		answer = [1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 5, 21, 22, 23, 24, 25, 26, 4]
		pfd_print(w, answer)
		self.assert_(w.getvalue() == "1 2 3 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 5 21 22 23 24 25 26 4 \n\n")
Ejemplo n.º 9
0
 def test_print_3(self):
     w = StringIO.StringIO()
     answer = [1]
     pfd_print(w, answer)
     self.assert_(w.getvalue() == "1 \n\n")
Ejemplo n.º 10
0
    def test_pfd_print_1(self):
        w = StringIO.StringIO()
        a = []
        pfd_print(w, a)

        self.assert_(w.getvalue() == "\n")
Ejemplo n.º 11
0
 def test_print_2 (self) :
     w = StringIO.StringIO()
     pfd_print(w,[4, 5, 6])
     print w.getvalue()
     self.assert_(w.getvalue() == "4 5 6")
Ejemplo n.º 12
0
 def test_print_3(self):
     w = StringIO.StringIO()
     pfd_print(w, [7, 8, 9])
     print w.getvalue()
     self.assert_(w.getvalue() == "7 8 9")
Ejemplo n.º 13
0
 def test_print_2(self):
     w = StringIO.StringIO()
     pfd_print(w, [4, 5, 6])
     print w.getvalue()
     self.assert_(w.getvalue() == "4 5 6")
Ejemplo n.º 14
0
 def test_print_1(self):
     w = StringIO.StringIO()
     pfd_print(w, [1, 2, 3])
     print w.getvalue()
     self.assert_(w.getvalue() == "1 2 3")
Ejemplo n.º 15
0
 def test_print_3 (self):
     w = StringIO.StringIO()
     pfd_print(w, [])
     self.assert_(w.getvalue() == "")
Ejemplo n.º 16
0
 def test_print_2 (self):
     w = StringIO.StringIO()
     pfd_print(w, ['1', '2', '3', ' '])
     self.assert_(w.getvalue() == "123 ")
Ejemplo n.º 17
0
 def test_pfd_print_2(self):
     a = ["1", "2", "3"]
     w = StringIO.StringIO()
     pfd_print(w, a)
     self.assert_(w.getvalue() == "1 2 3\n")
Ejemplo n.º 18
0
 def test_pfd_print_3(self):
     w = StringIO.StringIO()
     a = ["5", "1", "2", "3", "5"]
     pfd_print(w, a)
     self.assert_(w.getvalue() == "5 1 2 3 5\n")
Ejemplo n.º 19
0
 def test_print_4(self):
     w = StringIO.StringIO()
     answer = [3, 1, 5, 7, 10, 2, 8, 6, 9, 4]
     pfd_print(w, answer)
     self.assert_(w.getvalue() == "3 1 5 7 10 2 8 6 9 4 \n\n")
Ejemplo n.º 20
0
 def test_print_1 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [1, 2, 3])
     self.assert_(w.getvalue() == "1 2 3")
Ejemplo n.º 21
0
	def test_print_2 (self) :
		w = StringIO.StringIO()
		answer = [2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 1, 25, 26, 27, 10, 17, 28]
		pfd_print(w, answer)
		self.assert_(w.getvalue() == "2 3 4 5 6 7 8 9 11 12 13 14 15 16 18 19 20 21 22 23 24 1 25 26 27 10 17 28 \n\n")
Ejemplo n.º 22
0
 def test_print_3 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [7, 8, 9])
     self.assert_(w.getvalue() == "7 8 9")
Ejemplo n.º 23
0
	def test_print_4 (self) :
		w = StringIO.StringIO()
		answer = [3, 1, 5, 7, 10, 2, 8, 6, 9, 4]
		pfd_print(w, answer)
		self.assert_(w.getvalue() == "3 1 5 7 10 2 8 6 9 4 \n\n")
Ejemplo n.º 24
0
    def test_print_1 (self) :
        w = StringIO.StringIO()
        pfd_print(w, [1, 10, 20])
	s = w.getvalue()
	#print (s)
        self.assert_(s == "1 10 20 \n")
Ejemplo n.º 25
0
 def test_print_2 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [])
     self.assert_(w.getvalue() == "")
Ejemplo n.º 26
0
    def test_print_2 (self) :
        w = StringIO.StringIO()
        pfd_print(w, [1])
	s = w.getvalue()
	#print (s)
        self.assert_(s == "1 \n")
Ejemplo n.º 27
0
 def test_print_4 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [1, 2, 3, 4, 5])
     self.assert_(w.getvalue() == "1 2 3 4 5\n\n")
Ejemplo n.º 28
0
	def test_print_3 (self) :
		w = StringIO.StringIO()
		pfd_print(w, [1, 3, 5, 7, 9, 2, 4, 6, 8])
		self.assert_(w.getvalue() == "1 3 5 7 9 2 4 6 8")