Beispiel #1
0
 def test_StringIO_write(self):
     obj = StringIO.StringIO()
     assert_equal(util.isstream(obj), True)
     obj.close()
Beispiel #2
0
 def test_file(self):
     with open(datafiles.PSF) as obj:
         assert_equal(util.isstream(obj), True)
Beispiel #3
0
 def test_StringIO_read(self):
     with open(datafiles.PSF, "r") as f:
         obj = StringIO.StringIO(f)
     assert_equal(util.isstream(obj), True)
     obj.close()
Beispiel #4
0
 def test_list(self):
     obj = [1, 2, 3]
     assert_equal(util.isstream(obj), False)
Beispiel #5
0
 def test_iterator(self):
     obj = (i for i in xrange(3))
     assert_equal(util.isstream(obj), False)
Beispiel #6
0
 def test_StringIO_write(self):
     obj = StringIO.StringIO()
     assert_equal(util.isstream(obj), True)
     obj.close()
Beispiel #7
0
 def test_string(self):
     obj = datafiles.PSF  # filename
     assert_equal(util.isstream(obj), False)
Beispiel #8
0
 def test_StringIO_read(self):
     with open(datafiles.PSF, "r") as f:
         obj = StringIO.StringIO(f)
     assert_equal(util.isstream(obj), True)
     obj.close()
Beispiel #9
0
 def test_file(self):
     with open(datafiles.PSF) as obj:
         assert_equal(util.isstream(obj), True)
Beispiel #10
0
 def test_iterator(self):
     obj = (i for i in xrange(3))
     assert_equal(util.isstream(obj), False)
Beispiel #11
0
 def test_list(self):
     obj = [1, 2, 3]
     assert_equal(util.isstream(obj), False)
Beispiel #12
0
 def test_string(self):
     obj = datafiles.PSF  # filename
     assert_equal(util.isstream(obj), False)