Skip to content

Commit c39d62d

Browse files
committed
Add unittest
1 parent 74d3aa4 commit c39d62d

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ python:
44
install:
55
- pipenv install
66
script:
7-
- pytest
7+
- pytest
8+
- python tests.py

tests.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from unittest import TestCase, main
2+
from flask import current_app
3+
from app import create_app
4+
5+
6+
class BasicsTestCase(TestCase):
7+
def setUp(self):
8+
self.app = create_app('testing')
9+
self.app_context = self.app.app_context()
10+
self.app_context.push()
11+
12+
def tearDown(self):
13+
self.app_context.pop()
14+
15+
def test_app_exists(self):
16+
self.assertFalse(current_app is None)
17+
18+
def test_app_is_testing(self):
19+
self.assertTrue(current_app.config['TESTING'])
20+
21+
22+
if __name__ == '__main__':
23+
main(verbosity=2)

0 commit comments

Comments
 (0)