From d6be15ab911aa4ba9021b566ffcef99c2ed0f3fb Mon Sep 17 00:00:00 2001 From: Aaron Kable Date: Sat, 25 May 2024 18:27:44 +0800 Subject: [PATCH] add tests package --- .coverage | Bin 0 -> 86016 bytes .coveragerc | 21 + .github/workflows/main.yml | 30 +- aadiscordbot/tests/__init__.py | 51 + aadiscordbot/tests/test_utils_auth.py | 178 ++ coverage.xml | 2693 +++++++++++++++++++++++++ runtests.py | 23 + tests/__init__.py | 3 + tests/celery.py | 21 + tests/test_settings.py | 57 + tests/urls.py | 14 + tests/views.py | 5 + tox.ini | 22 + 13 files changed, 3103 insertions(+), 15 deletions(-) create mode 100644 .coverage create mode 100644 .coveragerc create mode 100644 aadiscordbot/tests/__init__.py create mode 100644 aadiscordbot/tests/test_utils_auth.py create mode 100644 coverage.xml create mode 100644 runtests.py create mode 100644 tests/__init__.py create mode 100644 tests/celery.py create mode 100644 tests/test_settings.py create mode 100644 tests/urls.py create mode 100644 tests/views.py create mode 100644 tox.ini diff --git a/.coverage b/.coverage new file mode 100644 index 0000000000000000000000000000000000000000..550d8c57a66a7376282f60889c612f602e969d17 GIT binary patch literal 86016 zcmeI52Y4LC-T!B9w#;@HWZ9O>8CSW;l5OE`S#EN#xXYGL(pfsIoP0XTa?h@4!C)|< z*z`~WNk|}sB$$NoCLsiZ^I~uaNgyFWLLk&o@=}uM|C^hevmGGM`#k?Ul9$Y3Tc4TT zo!$BF?008=GdfnSSR6}6!&~Etrbse89(6+)qnY6_Ldb%@dGJ?!bO1#p;3qzXKM5^V zRQ4;!TZ3%vV&rXhmU(0BYn@@%<93sAp>@3;F=}9g{740)0#X5~z<;&^{t8>q@6!hd zdy|ps#%MATsfi}|zs~HHbIZ@38$P>y*5bKgo);crhT$`2Ot?Ipi0=ruL=)kyvBqdP z)?6E_i6mpqb>U=vRP5c>8m(n7I>>`p9ow-ebv&c0SS=itjMhOBEs0oDB(XEx5ZyUC zwL|)B$!JHCXFws*SY0#QBRnE~cwsmZ-5O0qn`@%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+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/runtests.py b/runtests.py new file mode 100644 index 0000000..344c531 --- /dev/null +++ b/runtests.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings' + print(os.getcwd()) + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django # NOQA + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv.insert(1, 'test')) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..cd04264 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +from .celery import app as celery_app + +__all__ = ['celery_app'] diff --git a/tests/celery.py b/tests/celery.py new file mode 100644 index 0000000..a15cb48 --- /dev/null +++ b/tests/celery.py @@ -0,0 +1,21 @@ +import os + +from celery import Celery + +# set the default Django settings module for the 'celery' program. +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') + +from django.conf import settings # noqa + +app = Celery('devauth') + +# Using a string here means the worker don't have to serialize +# the configuration object to child processes. +app.config_from_object('django.conf:settings') +app.conf.ONCE = { + 'backend': 'allianceauth.services.tasks.DjangoBackend', + 'settings': {} +} + +# Load task modules from all registered Django app configs. +app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) diff --git a/tests/test_settings.py b/tests/test_settings.py new file mode 100644 index 0000000..28cc304 --- /dev/null +++ b/tests/test_settings.py @@ -0,0 +1,57 @@ +""" +Alliance Auth Test Suite Django settings. +""" + +from allianceauth.project_template.project_name.settings.base import * # NOQA + +SITE_URL = "test_auth.auth" +# Celery configuration +CELERY_ALWAYS_EAGER = True # Forces celery to run locally for testing + +INSTALLED_APPS += [ # NOQA + 'aadiscordbot', + 'aadiscordmultiverse', + 'allianceauth.services.modules.discord' +] + +ROOT_URLCONF = 'tests.urls' + +NOSE_ARGS = [ + # '--with-coverage', + # '--cover-package=', + # '--exe', # If your tests need this to be found/run, check they py files are not chmodded +x +] + + +PASSWORD_HASHERS = [ + 'django.contrib.auth.hashers.MD5PasswordHasher', +] + +# LOGGING = None # Comment out to enable logging for debugging + +# Register an application at https://developers.eveonline.com for Authentication +# & API Access and fill out these settings. Be sure to set the callback URL +# to https://example.com/sso/callback substituting your domain for example.com +# Logging in to auth requires the publicData scope (can be overridden through the +# LOGIN_TOKEN_SCOPES setting). Other apps may require more (see their docs). +ESI_SSO_CLIENT_ID = '123' +ESI_SSO_CLIENT_SECRET = '123' +ESI_SSO_CALLBACK_URL = '123' + +CACHES = { + "default": { + # "BACKEND": "redis_cache.RedisCache", + # "LOCATION": "localhost:6379", + # "OPTIONS": { + # "DB": 1, + # } + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://localhost:6379/1", + "OPTIONS": { + "COMPRESSOR": "django_redis.compressors.lzma.LzmaCompressor", + } + } +} + +DISCORD_BOT_TOKEN = "test_token" +DISCORD_GUILD_ID = 1234567891011 diff --git a/tests/urls.py b/tests/urls.py new file mode 100644 index 0000000..afc1427 --- /dev/null +++ b/tests/urls.py @@ -0,0 +1,14 @@ +from django.urls import path + +import allianceauth.urls + +from . import views + +urlpatterns = allianceauth.urls.urlpatterns + +urlpatterns += [ + # Navhelper test urls + path('main-page/', views.page, name='p1'), + path('main-page/sub-section/', views.page, name='p1-s1'), + path('second-page/', views.page, name='p1'), +] diff --git a/tests/views.py b/tests/views.py new file mode 100644 index 0000000..bc14824 --- /dev/null +++ b/tests/views.py @@ -0,0 +1,5 @@ +from django.http import HttpResponse + + +def page(request): + return HttpResponse('Hello World!') diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..827fc9e --- /dev/null +++ b/tox.ini @@ -0,0 +1,22 @@ +[tox] +skipsdist = False +usedevelop = True +envlist = py3 + +[testenv] +setenv = + DJANGO_SETTINGS_MODULE = tests.test_settings + +basepython = + py3: python3 + +deps= + coverage + allianceauth-discord-multiverse @ git+https://github.com/Solar-Helix-Independent-Transport/allianceauth-discord-multiverse.git + +commands = + pip freeze + coverage run runtests.py + coverage report -m + coverage html + coverage xml