]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121842: Improve coverage of `PyBytes_FromStringAndSize` (#121843)
authorsobolevn <mail@sobolevn.me>
Wed, 17 Jul 2024 07:00:07 +0000 (10:00 +0300)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2024 07:00:07 +0000 (10:00 +0300)
Lib/test/test_capi/test_bytes.py

index f14d5545c829e541848125fcb88b22742997b661..d5f047bcf182779f1638d3f210ecd346cc995ef9 100644 (file)
@@ -53,6 +53,8 @@ class CAPITest(unittest.TestCase):
         self.assertEqual(fromstringandsize(b'abc'), b'abc')
         self.assertEqual(fromstringandsize(b'abc', 2), b'ab')
         self.assertEqual(fromstringandsize(b'abc\0def'), b'abc\0def')
+        self.assertEqual(fromstringandsize(b'a'), b'a')
+        self.assertEqual(fromstringandsize(b'a', 1), b'a')
         self.assertEqual(fromstringandsize(b'', 0), b'')
         self.assertEqual(fromstringandsize(NULL, 0), b'')
         self.assertEqual(len(fromstringandsize(NULL, 3)), 3)