File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ def test_validate(self):
40
40
class TestWebhookParser (unittest .TestCase ):
41
41
def test_parse (self ):
42
42
file_dir = os .path .dirname (__file__ )
43
- body = open (
44
- os . path . join ( file_dir , 'text' , 'webhook.json' )
45
- ) .read ()
43
+ webhook_sample_json_path = os . path . join ( file_dir , 'text' , 'webhook.json' )
44
+ with open ( webhook_sample_json_path ) as fp :
45
+ body = fp .read ()
46
46
47
47
parser = WebhookParser ('channel_secret' )
48
48
# mock
@@ -315,9 +315,9 @@ def default(event):
315
315
316
316
def test_hoge (self ):
317
317
file_dir = os .path .dirname (__file__ )
318
- body = open (
319
- os . path . join ( file_dir , 'text' , 'webhook.json' )
320
- ) .read ()
318
+ webhook_sample_json_path = os . path . join ( file_dir , 'text' , 'webhook.json' )
319
+ with open ( webhook_sample_json_path ) as fp :
320
+ body = fp .read ()
321
321
322
322
# mock
323
323
self .handler .parser .signature_validator .validate = lambda a , b : True
You can’t perform that action at this time.
0 commit comments