]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: fix test case in test_tls.py
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 23 Apr 2025 15:23:43 +0000 (11:23 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 7 Jul 2025 13:32:24 +0000 (09:32 -0400)
Why violate the typing in a test? mypy never noticed this because tests
are not type checked but there seems to be no need to turn a str into
bytes to pass to a function that is typed only as taking str!

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/tests/test_tls.py

index 840869514f1bf6e03a7fb5cd7273bb7c8e197801..bf006919e0c44cc76e25fb77441cab55fcbea2ed 100644 (file)
@@ -31,7 +31,7 @@ class TLSchecks(unittest.TestCase):
         crt, key = create_self_signed_cert()
 
         # fudge the key, to force an error to be detected during verify_tls
-        fudged = f"{key[:-35]}c0ffee==\n{key[-25:]}".encode('utf-8')
+        fudged = f"{key[:-35]}c0ffee==\n{key[-25:]}"
         self.assertRaises(ServerConfigException, verify_tls, crt, fudged)
 
     def test_mismatched_tls(self):