summaryrefslogtreecommitdiff
path: root/tests/files/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/files/tests.py')
-rw-r--r--tests/files/tests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/files/tests.py b/tests/files/tests.py
index cd2ccaf9f1..2ce4d0139d 100644
--- a/tests/files/tests.py
+++ b/tests/files/tests.py
@@ -120,6 +120,19 @@ class FileTests(unittest.TestCase):
f = File(StringIO('one\ntwo\nthree'))
self.assertEqual(list(f), ['one\n', 'two\n', 'three'])
+ def test_seekable(self):
+ """
+ File.seekable() should be available on Python 3.
+ """
+ with tempfile.TemporaryFile() as temp:
+ temp.write(b"contents\n")
+ test_file = File(temp, name="something.txt")
+ if six.PY2:
+ self.assertFalse(hasattr(test_file, 'seekable'))
+ if six.PY3:
+ self.assertTrue(hasattr(test_file, 'seekable'))
+ self.assertTrue(test_file.seekable())
+
class NoNameFileTestCase(unittest.TestCase):
"""