diff options
author | willmcgugan@gmail.com <willmcgugan@gmail.com@67cdc799-7952-0410-af00-57a81ceafa0f> | 2014-10-16 14:07:23 +0000 |
---|---|---|
committer | willmcgugan@gmail.com <willmcgugan@gmail.com@67cdc799-7952-0410-af00-57a81ceafa0f> | 2014-10-16 14:07:23 +0000 |
commit | e103eb90c24901d06b8a8abc48201aa2dbba890c (patch) | |
tree | 6873e2b9ff07b8a54a6117d949c85b95d503d181 /fs/tests | |
parent | 4174a9e79d56d66e0b90411f5589537a452f51f7 (diff) | |
download | pyfilesystem-e103eb90c24901d06b8a8abc48201aa2dbba890c.tar.gz |
Fixes, including hang bug in readline
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@899 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/tests')
-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")) |