示例#1
0
 def test_raw_input_(self):
     StringIO = compat.get_StringIO()
     msg = "success"
     tmp = sys.stdin
     sys.stdin = StringIO(msg + "\n")
     try:
         s = compat.raw_input_()
         self.assertEqual(s, msg)
     finally:
         sys.stdin = tmp
示例#2
0
 def test_raw_input_(self):
     StringIO = compat.get_StringIO()
     msg = 'success'
     tmp = sys.stdin
     sys.stdin = StringIO(msg + '\n')
     try:
         s = compat.raw_input_()
         self.failUnlessEqual(s, msg)
     finally:
         sys.stdin = tmp
示例#3
0
 def test_raw_input_(self):
     StringIO = compat.get_StringIO()
     msg = 'success'
     tmp = sys.stdin
     sys.stdin = StringIO(msg + '\n')
     try:
         s = compat.raw_input_()
         self.failUnlessEqual(s, msg)
     finally:
         sys.stdin = tmp
示例#4
0
 def test_get_StringIO(self):
     StringIO = compat.get_StringIO()
     b1 = "abcde"
     b2 = StringIO(b1).read()
     self.assertIsInstance(b2, str)
     self.assertEqual(b2, b1)
示例#5
0
 def test_get_StringIO(self):
     StringIO = compat.get_StringIO()
     b1 = "abcde"
     b2 = StringIO(b1).read()
     self.failUnless(isinstance(b2, str))
     self.failUnlessEqual(b2, b1)
示例#6
0
 def test_get_StringIO(self):
     StringIO = compat.get_StringIO()
     b1 = "abcde"
     b2 = StringIO(b1).read()
     self.failUnless(isinstance(b2, str))
     self.failUnlessEqual(b2, b1)