2 from StringIO import StringIO
3 from tempfile import NamedTemporaryFile
4 from nose.tools import *
5 from librarian import IOFile
7 def test_iofile_from_string_reusable():
8 some_file = IOFile.from_string("test")
9 some_file.get_file().read()
10 assert_equal(some_file.get_file().read(), "test")
12 def test_iofile_from_filename_reusable():
13 temp = NamedTemporaryFile(delete=False)
17 some_file = IOFile.from_filename(temp.name)
18 some_file.get_file().read()
19 assert_equal(some_file.get_file().read(), "test")