Skip to content

Commit 4fc14b1

Browse files
ravg998tomasr8
authored andcommitted
Test that ValueError is raised when vfsopen is passed an invalid mode (GH-154008)
* ValueError with message test * Remove white space * Apply suggestions from code review Change from double quotes to single quotes. Co-authored-by: Tomas R. <tomas.roun8@gmail.com> --------- (cherry picked from commit 9f5af27) Co-authored-by: Rayan <157278782+ravg998@users.noreply.github.com> Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
1 parent 6f198d2 commit 4fc14b1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/test/test_pathlib/test_read.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ def test_info_is_symlink(self):
323323
self.assertFalse((p / 'fileA\udfff').info.is_symlink())
324324
self.assertFalse((p / 'fileA\x00').info.is_symlink())
325325

326+
def test_invalid_mode(self):
327+
p = self.root / 'fileA'
328+
with self.assertRaisesRegex(ValueError, 'invalid mode'):
329+
vfsopen(p, 'q')
330+
326331

327332
class ZipPathReadTest(ReadTestBase, unittest.TestCase):
328333
ground = ZipPathGround(ReadableZipPath)

0 commit comments

Comments
 (0)