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
Beispiel #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
 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
 def test_get_StringIO(self):
     StringIO = compat.get_StringIO()
     b1 = "abcde"
     b2 = StringIO(b1).read()
     self.assertIsInstance(b2, str)
     self.assertEqual(b2, b1)
Beispiel #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)
 def test_get_StringIO(self):
     StringIO = compat.get_StringIO()
     b1 = "abcde"
     b2 = StringIO(b1).read()
     self.failUnless(isinstance(b2, str))
     self.failUnlessEqual(b2, b1)