Skip to content

Commit 0ca781b

Browse files
committed
Updated test to account for Flask API changes
1 parent ec11448 commit 0ca781b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

github_webhook/test_webhook.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
"""Tests for github_webhook.webhook"""
22

3-
from __future__ import print_function
43

54
import unittest
6-
try:
7-
from unittest.mock import Mock
8-
except ImportError:
9-
from mock import Mock
5+
from unittest.mock import Mock
6+
107

118
from github_webhook.webhook import Webhook
129

1310

1411
class TestWebhook(unittest.TestCase):
15-
1612
def test_constructor(self):
1713
# GIVEN
1814
app = Mock()
@@ -22,7 +18,12 @@ def test_constructor(self):
2218

2319
# THEN
2420
app.add_url_rule.assert_called_once_with(
25-
'/postreceive', view_func=webhook._postreceive, methods=['POST'])
21+
rule="/postreceive",
22+
endpoint="/postreceive",
23+
view_func=webhook._postreceive,
24+
methods=["POST"],
25+
)
26+
2627

2728
# -----------------------------------------------------------------------------
2829
# Copyright 2015 Bloomberg Finance L.P.

0 commit comments

Comments
 (0)