예제 #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"
     )
예제 #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"
     )
예제 #3
0
파일: TestPFD.py 프로젝트: cjp420/cs373-pfd
    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")
예제 #4
0
 def test_print_1 (self):
     w = StringIO.StringIO()
     pfd_print(w, ['2', '3', ' ', ' ', 'hello'])
     self.assert_(w.getvalue() == "23  hello")
예제 #5
0
 def test_print_3 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [1])
     self.assert_(w.getvalue() == "1\n\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")
예제 #7
0
	def test_print_3 (self) :
		w = StringIO.StringIO()
		answer = [1]
		pfd_print(w, answer)
		self.assert_(w.getvalue() == "1 \n\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")
예제 #9
0
 def test_print_3(self):
     w = StringIO.StringIO()
     answer = [1]
     pfd_print(w, answer)
     self.assert_(w.getvalue() == "1 \n\n")
예제 #10
0
    def test_pfd_print_1(self):
        w = StringIO.StringIO()
        a = []
        pfd_print(w, a)

        self.assert_(w.getvalue() == "\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")
예제 #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")
예제 #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")
예제 #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")
예제 #15
0
 def test_print_3 (self):
     w = StringIO.StringIO()
     pfd_print(w, [])
     self.assert_(w.getvalue() == "")
예제 #16
0
 def test_print_2 (self):
     w = StringIO.StringIO()
     pfd_print(w, ['1', '2', '3', ' '])
     self.assert_(w.getvalue() == "123 ")
예제 #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")
예제 #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")
예제 #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")
예제 #20
0
 def test_print_1 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [1, 2, 3])
     self.assert_(w.getvalue() == "1 2 3")
예제 #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")
예제 #22
0
 def test_print_3 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [7, 8, 9])
     self.assert_(w.getvalue() == "7 8 9")
예제 #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")
예제 #24
0
파일: TestPFD.py 프로젝트: cjp420/cs373-pfd
    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")
예제 #25
0
 def test_print_2 (self) :
     w = StringIO.StringIO()
     pfd_print(w, [])
     self.assert_(w.getvalue() == "")
예제 #26
0
파일: TestPFD.py 프로젝트: cjp420/cs373-pfd
    def test_print_2 (self) :
        w = StringIO.StringIO()
        pfd_print(w, [1])
	s = w.getvalue()
	#print (s)
        self.assert_(s == "1 \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")
예제 #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")