This repository was archived by the owner on Apr 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ class TestSign(unittest.TestCase):
1717
1818 def setUp (self ):
1919 self .key_path = os .path .join (os .path .dirname (__file__ ), 'rsa_private.pem' )
20- self .key = open (self .key_path , 'rb' ).read ()
20+ with open (self .key_path , 'rb' ) as f :
21+ self .key = f .read ()
2122
2223 def test_default (self ):
2324 hs = sign .HeaderSigner (key_id = 'Test' , secret = self .key )
Original file line number Diff line number Diff line change @@ -144,10 +144,12 @@ def setUp(self):
144144class TestVerifyRSASHA1 (TestVerifyHMACSHA1 ):
145145 def setUp (self ):
146146 private_key_path = os .path .join (os .path .dirname (__file__ ), 'rsa_private.pem' )
147- private_key = open (private_key_path , 'rb' ).read ()
147+ with open (private_key_path , 'rb' ) as f :
148+ private_key = f .read ()
148149
149150 public_key_path = os .path .join (os .path .dirname (__file__ ), 'rsa_public.pem' )
150- public_key = open (public_key_path , 'rb' ).read ()
151+ with open (public_key_path , 'rb' ) as f :
152+ public_key = f .read ()
151153
152154 self .keyId = "Test"
153155 self .algorithm = "rsa-sha1"
You can’t perform that action at this time.
0 commit comments