mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-95395: Add argument type error test (GH-95412) (GH-95745)
(cherry picked from commit 4703c15811
)
Co-authored-by: Sion Kang <31057849+Yaminyam@users.noreply.github.com>
This commit is contained in:
parent
32b71ffbdb
commit
9278fc4e27
1 changed files with 3 additions and 1 deletions
|
@ -49,10 +49,12 @@ class GroupDatabaseTestCase(unittest.TestCase):
|
|||
|
||||
def test_errors(self):
|
||||
self.assertRaises(TypeError, grp.getgrgid)
|
||||
self.assertRaises(TypeError, grp.getgrgid, 3.14)
|
||||
self.assertRaises(TypeError, grp.getgrnam)
|
||||
self.assertRaises(TypeError, grp.getgrnam, 42)
|
||||
self.assertRaises(TypeError, grp.getgrall, 42)
|
||||
# embedded null character
|
||||
self.assertRaises(ValueError, grp.getgrnam, 'a\x00b')
|
||||
self.assertRaisesRegex(ValueError, 'null', grp.getgrnam, 'a\x00b')
|
||||
|
||||
# try to get some errors
|
||||
bynames = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue