Skip to content

Commit 47836cf

Browse files
committed
unittest
1 parent cfb654b commit 47836cf

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

tests.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
from unittest import TestCase
22

3+
from flask import Flask
4+
from flask import _app_ctx_stack as stack
5+
from flask_pyfcm import FCM
6+
from pyfcm import FCMNotification
37

48
class FCMExtensionTest(TestCase):
9+
510
def setUp(self):
6-
pass
11+
self.app = Flask('unit_tests')
12+
13+
14+
self.fcm = FCM()
15+
16+
def create_app():
17+
app = Flask(__name__)
18+
app.config['FCM_API_KEY'] = 'test-key'
19+
app.config['FCM_PROXY_DICT'] = {}
20+
self.fcm.init_app(app)
21+
return app
22+
23+
self.app = create_app()
724

8-
def test(self):
9-
pass
25+
def test_001_application_context(self):
26+
with self.app.app_context():
27+
self.fcm.push_service
28+
self.assertIsInstance(stack.top.fcm_service, FCMNotification)

0 commit comments

Comments
 (0)