Exemple #1
0
 def test_StringIO_write(self):
     obj = StringIO.StringIO()
     assert_equal(util.isstream(obj), True)
     obj.close()
Exemple #2
0
 def test_file(self):
     with open(datafiles.PSF) as obj:
         assert_equal(util.isstream(obj), True)
Exemple #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()
Exemple #4
0
 def test_list(self):
     obj = [1, 2, 3]
     assert_equal(util.isstream(obj), False)
Exemple #5
0
 def test_iterator(self):
     obj = (i for i in xrange(3))
     assert_equal(util.isstream(obj), False)
Exemple #6
0
 def test_StringIO_write(self):
     obj = StringIO.StringIO()
     assert_equal(util.isstream(obj), True)
     obj.close()
Exemple #7
0
 def test_string(self):
     obj = datafiles.PSF  # filename
     assert_equal(util.isstream(obj), False)
Exemple #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()
Exemple #9
0
 def test_file(self):
     with open(datafiles.PSF) as obj:
         assert_equal(util.isstream(obj), True)
Exemple #10
0
 def test_iterator(self):
     obj = (i for i in xrange(3))
     assert_equal(util.isstream(obj), False)
Exemple #11
0
 def test_list(self):
     obj = [1, 2, 3]
     assert_equal(util.isstream(obj), False)
Exemple #12
0
 def test_string(self):
     obj = datafiles.PSF  # filename
     assert_equal(util.isstream(obj), False)