Add boilerplate for unit testing
This commit is contained in:
parent
2fb474c87c
commit
91fbb3dde1
22
djangoldp_webpushnotification/tests/runner.py
Normal file
22
djangoldp_webpushnotification/tests/runner.py
Normal file
@ -0,0 +1,22 @@
|
||||
import sys
|
||||
|
||||
import django
|
||||
import yaml
|
||||
from django.conf import settings as django_settings
|
||||
from djangoldp.conf.ldpsettings import LDPSettings
|
||||
from djangoldp_webpushnotification.tests.settings_default import yaml_config
|
||||
|
||||
config = yaml.safe_load(yaml_config)
|
||||
ldpsettings = LDPSettings(config)
|
||||
django_settings.configure(ldpsettings)
|
||||
|
||||
django.setup()
|
||||
from django.test.runner import DiscoverRunner
|
||||
|
||||
test_runner = DiscoverRunner(verbosity=1)
|
||||
|
||||
failures = test_runner.run_tests([
|
||||
'djangoldp_webpushnotification.tests.tests_vapidkeyset',
|
||||
])
|
||||
if failures:
|
||||
sys.exit(failures)
|
11
djangoldp_webpushnotification/tests/settings_default.py
Normal file
11
djangoldp_webpushnotification/tests/settings_default.py
Normal file
@ -0,0 +1,11 @@
|
||||
"""YAML configurations for djangoldp_webpushnotification testing."""
|
||||
|
||||
yaml_config = """
|
||||
dependencies:
|
||||
|
||||
ldppackages:
|
||||
- djangoldp_webpushnotification.tests
|
||||
|
||||
server:
|
||||
INSTALLED_APPS: []
|
||||
"""
|
6
djangoldp_webpushnotification/tests/tests_vapidkeyset.py
Normal file
6
djangoldp_webpushnotification/tests/tests_vapidkeyset.py
Normal file
@ -0,0 +1,6 @@
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
class TestRSAKey(TestCase):
|
||||
def test_foobar(self):
|
||||
assert 2 == 2
|
Reference in New Issue
Block a user