diff options
Diffstat (limited to 'fs/tests/__init__.py')
-rw-r--r-- | fs/tests/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/tests/__init__.py b/fs/tests/__init__.py index 3aa8ec8..7af1476 100644 --- a/fs/tests/__init__.py +++ b/fs/tests/__init__.py @@ -147,6 +147,13 @@ class FSTestCases(object): self.fs.createfile("test.txt", wipe=True) self.assertEqual(self.fs.getcontents("test.txt", "rb"), b('')) + def test_readline(self): + text = b"Hello\nWorld\n" + self.fs.setcontents('a.txt', text) + with self.fs.open('a.txt', 'rb') as f: + line = f.readline() + self.assertEqual(line, b"Hello\n") + def test_setcontents(self): # setcontents() should accept both a string... self.fs.setcontents("hello", b("world")) |