summaryrefslogtreecommitdiffhomepage
path: root/tests/test_file.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_file.py')
-rw-r--r--tests/test_file.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/test_file.py b/tests/test_file.py
index fba14b1b..2a3da74b 100644
--- a/tests/test_file.py
+++ b/tests/test_file.py
@@ -52,7 +52,7 @@ class LoopbackFile(BufferedFile):
class BufferedFileTest(unittest.TestCase):
- def test_1_simple(self):
+ def test_simple(self):
f = LoopbackFile("r")
try:
f.write(b"hi")
@@ -69,7 +69,7 @@ class BufferedFileTest(unittest.TestCase):
pass
f.close()
- def test_2_readline(self):
+ def test_readline(self):
f = LoopbackFile("r+U")
f.write(
b"First line.\nSecond line.\r\nThird line.\n"
@@ -96,7 +96,7 @@ class BufferedFileTest(unittest.TestCase):
self.assertTrue(crlf in f.newlines)
self.assertTrue(cr_byte not in f.newlines)
- def test_3_lf(self):
+ def test_lf(self):
"""
try to trick the linefeed detector.
"""
@@ -108,7 +108,7 @@ class BufferedFileTest(unittest.TestCase):
f.close()
self.assertEqual(f.newlines, crlf)
- def test_4_write(self):
+ def test_write(self):
"""
verify that write buffering is on.
"""
@@ -120,7 +120,7 @@ class BufferedFileTest(unittest.TestCase):
self.assertEqual(f.readline(), "Incomplete line...\n")
f.close()
- def test_5_flush(self):
+ def test_flush(self):
"""
verify that flush will force a write.
"""
@@ -134,7 +134,7 @@ class BufferedFileTest(unittest.TestCase):
self.assertEqual(f.read(3), b"")
f.close()
- def test_6_buffering(self):
+ def test_buffering_flushes(self):
"""
verify that flushing happens automatically on buffer crossing.
"""
@@ -147,7 +147,7 @@ class BufferedFileTest(unittest.TestCase):
self.assertEqual(f.read(20), b"Too small. Enough.")
f.close()
- def test_7_read_all(self):
+ def test_read_all(self):
"""
verify that read(-1) returns everything left in the file.
"""
@@ -162,30 +162,30 @@ class BufferedFileTest(unittest.TestCase):
)
f.close()
- def test_8_buffering(self):
+ def test_buffering_writes(self):
"""
verify that buffered objects can be written
"""
if sys.version_info[0] == 2:
f = LoopbackFile("r+", 16)
- f.write(buffer(b"Too small."))
+ f.write(buffer(b"Too small.")) # noqa
f.close()
- def test_9_readable(self):
+ def test_readable(self):
f = LoopbackFile("r")
self.assertTrue(f.readable())
self.assertFalse(f.writable())
self.assertFalse(f.seekable())
f.close()
- def test_A_writable(self):
+ def test_writable(self):
f = LoopbackFile("w")
self.assertTrue(f.writable())
self.assertFalse(f.readable())
self.assertFalse(f.seekable())
f.close()
- def test_B_readinto(self):
+ def test_readinto(self):
data = bytearray(5)
f = LoopbackFile("r+")
f._write(b"hello")
@@ -215,7 +215,7 @@ class BufferedFileTest(unittest.TestCase):
offsets = range(0, len(data), 8)
with LoopbackFile("rb+") as f:
for offset in offsets:
- f.write(buffer(data, offset, 8))
+ f.write(buffer(data, offset, 8)) # noqa
self.assertEqual(f.read(), data)
@needs_builtin("memoryview")