From f79d88e6cdeb85a1be402d17f238670d5964edbe Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 19 Dec 2021 20:39:46 +0100 Subject: [PATCH] Fix all unit tests for contribs --- evennia/commands/default/tests.py | 8 +++++++- evennia/contrib/__init__.py | 14 +------------- evennia/contrib/tutorials/mirror/__init__.py | 2 +- evennia/web/urls.py | 4 ++-- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index c0e80cdfc0..c426a2879a 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -2178,10 +2178,16 @@ class TestComms(CommandTest): class TestBatchProcess(CommandTest): + """ + Test the batch processor. + + """ + # there is some sort of issue with the mock; it needs to loaded once to work + from evennia.contrib.tutorials.red_button import red_button # noqa @patch("evennia.contrib.tutorials.red_button.red_button.repeat") @patch("evennia.contrib.tutorials.red_button.red_button.delay") - def test_batch_commands(self, mock_delay, mock_repeat): + def test_batch_commands(self, mock_tutorials, mock_repeat): # cannot test batchcode here, it must run inside the server process self.call( batchprocess.CmdBatchCommands(), diff --git a/evennia/contrib/__init__.py b/evennia/contrib/__init__.py index c379bb1cf7..190071a331 100644 --- a/evennia/contrib/__init__.py +++ b/evennia/contrib/__init__.py @@ -4,17 +4,5 @@ This sub-package holds Evennia's contributions - code that may be useful but are deemed too game-specific to go into the core library. See README.md for more info. -""" -# imports for apidoc / turned off, due to typeclass-clashes; if imported -# like this; Django finds these typeclasses and makes for example Weapon -# unavailable to the user to add (since it exists in tutorialworld). We might -# need to change all names of contrib typeclasses (name them e.g. ContribTutorialWeapon -# or something); For now, we can un-comment this block ONLY for creating apidocs, -# but even so, you will get clashes when both using the tutorialworld and your -# own code, so somthing needs to be done here. See issue #766. /Griatch -# import evennia -# evennia._init() -# import barter, dice, extended_room, menu_login, talking_npc -# import chargen, email_login, gendersub, menusystem, slow_exit -# import tutorial_world, tutorial_examples +""" diff --git a/evennia/contrib/tutorials/mirror/__init__.py b/evennia/contrib/tutorials/mirror/__init__.py index 1f8d743d06..071bf825c3 100644 --- a/evennia/contrib/tutorials/mirror/__init__.py +++ b/evennia/contrib/tutorials/mirror/__init__.py @@ -3,4 +3,4 @@ Mirror object - Griatch 2015. """ -from . import TutorialMirror # noqa +from .mirror import TutorialMirror # noqa diff --git a/evennia/web/urls.py b/evennia/web/urls.py index 36e54beab2..c1dd78c1ea 100644 --- a/evennia/web/urls.py +++ b/evennia/web/urls.py @@ -28,8 +28,8 @@ urlpatterns = [ path("", include("evennia.web.website.urls")), # webclient path("webclient/", include("evennia.web.webclient.urls")), - # admin - path("admin/", include("evennia.web.admin.urls")), + # admin - + # path("admin/", include("evennia.web.admin.urls")), # favicon path("favicon.ico", RedirectView.as_view(url="/media/images/favicon.ico", permanent=False)), ]