def test_StringIO_write(self): obj = StringIO.StringIO() assert_equal(util.isstream(obj), True) obj.close()
def test_file(self): with open(datafiles.PSF) as obj: assert_equal(util.isstream(obj), True)
def test_StringIO_read(self): with open(datafiles.PSF, "r") as f: obj = StringIO.StringIO(f) assert_equal(util.isstream(obj), True) obj.close()
def test_list(self): obj = [1, 2, 3] assert_equal(util.isstream(obj), False)
def test_iterator(self): obj = (i for i in xrange(3)) assert_equal(util.isstream(obj), False)
def test_string(self): obj = datafiles.PSF # filename assert_equal(util.isstream(obj), False)