def test_print_2 (self) :
     w = io.StringIO()
     xmlPrint(w, [2,2,7])
     print(w.getvalue())
     self.assertTrue(w.getvalue() == "2\n2\n7\n\n")
 def test_print_3 (self) :
     w = io.StringIO()
     xmlPrint(w, [4,9,13,15])
     print(w.getvalue())
     self.assertTrue(w.getvalue() == "4\n9\n13\n15\n\n")
Example #3
0
 def test_print4(self):
     w = io.StringIO()
     a = []
     xmlPrint(w, 0, a)
     self.assertTrue(w.getvalue() == "0\n")
 def test_print_1 (self) :
     w = io.StringIO()
     xmlPrint(w, [0])
     print(w.getvalue())
     self.assertTrue(w.getvalue() == "0\n\n")
Example #5
0
 def test_print2(self):
     w = io.StringIO()
     a = [8,17,33,45]
     xmlPrint(w, 4, a)
     self.assertTrue(w.getvalue() == "4\n8\n17\n33\n45\n")
Example #6
0
 def test_print3(self):
     w = io.StringIO()
     a = [1]
     xmlPrint(w, 1, a)
     self.assertTrue(w.getvalue() == "1\n1\n")
Example #7
0
 def test_xmlPrint_tuple_trash (self) :
     w = StringIO.StringIO()
     ans = (2, "trash", [1])
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "2\ntrash\n[1]\n\n")
Example #8
0
 def test_print1(self):
     w = io.StringIO()
     a = [3,5,7]
     xmlPrint(w, 3, a)
     self.assertTrue(w.getvalue() == "3\n3\n5\n7\n")
Example #9
0
 def test_xmlPrint_tuple_1 (self) :
     w = StringIO.StringIO()
     ans = (1, 4)
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "1\n4\n\n")
Example #10
0
 def test_xmlPrint_tuple_2 (self) :
     w = StringIO.StringIO()
     ans = (2, 2, 7)
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "2\n2\n7\n\n")
Example #11
0
 def test_xmlPrint_empty (self) :
     w = StringIO.StringIO()
     ans = () # parens or empty tuple?
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "\n")
Example #12
0
 def test_xmlPrint_tuple_trash(self):
     w = StringIO.StringIO()
     ans = (2, "trash", [1])
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "2\ntrash\n[1]\n\n")
Example #13
0
 def test_xmlPrint_tuple_2(self):
     w = StringIO.StringIO()
     ans = (2, 2, 7)
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "2\n2\n7\n\n")
Example #14
0
 def test_xmlPrint_tuple_1(self):
     w = StringIO.StringIO()
     ans = (1, 4)
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "1\n4\n\n")
Example #15
0
 def test_xmlPrint_empty(self):
     w = StringIO.StringIO()
     ans = ()  # parens or empty tuple?
     xmlPrint(ans, w)
     self.assert_(w.getvalue() == "\n")