Permalink
Browse files

add basic testing boilerplate

  • Loading branch information...
1 parent b8b4d01 commit 6bb00146f8917f0d9b82f4b511649f006015d354 @Sketchy502 committed Jul 22, 2016
Showing with 37 additions and 0 deletions.
  1. +21 −0 tests/__init_.py
  2. +16 −0 tests/tests.py
View
@@ -0,0 +1,21 @@
+import sys
+import unittest
+
+import coverage
+
+
+def run():
+ # start coverage engine
+ cov = coverage.Coverage(branch=True)
+ cov.start()
+
+ # run tests
+ tests = unittest.TestLoader().discover('.')
+ ok = unittest.TextTestRunner(verbosity=2).run(tests).wasSuccessful()
+
+ # print coverage report
+ cov.stop()
+ print('')
+ cov.report(omit=['manage.py', 'tests/*', 'venv*/*'])
+
+ sys.exit(0 if ok else 1)
View
@@ -0,0 +1,16 @@
+from sdv import create_app
+import unittest
+
+
+class SDVTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.app = create_app('testing')
+
+ self.ctx = self.app.app_context()
+ self.ctx.push()
+
+ self.client = self.app.test_client()
+
+ def tearDown(self):
+ self.ctx.pop()

0 comments on commit 6bb0014

Please sign in to comment.