Skip to content

Commit 9f5af27

Browse files
ravg998tomasr8
andauthored
Test that ValueError is raised when vfsopen is passed an invalid mode (#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> --------- Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
1 parent 4b60b46 commit 9f5af27

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
@@ -329,6 +329,11 @@ def test_info_is_symlink(self):
329329
self.assertFalse((p / 'fileA\udfff').info.is_symlink())
330330
self.assertFalse((p / 'fileA\x00').info.is_symlink())
331331

332+
def test_invalid_mode(self):
333+
p = self.root / 'fileA'
334+
with self.assertRaisesRegex(ValueError, 'invalid mode'):
335+
vfsopen(p, 'q')
336+
332337

333338
class ZipPathReadTest(ReadTestBase, unittest.TestCase):
334339
ground = ZipPathGround(ReadableZipPath)

0 commit comments

Comments
 (0)