mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 01:36:32 +01:00
Add test for unconnected commands, add INFO command to test set.
This commit is contained in:
parent
567243a3fc
commit
2ab99ee1bf
1 changed files with 12 additions and 2 deletions
|
|
@ -14,15 +14,16 @@ main test suite started with
|
|||
|
||||
import re
|
||||
import types
|
||||
import datetime
|
||||
|
||||
from django.conf import settings
|
||||
from mock import Mock, mock
|
||||
|
||||
from evennia.commands.default.cmdset_character import CharacterCmdSet
|
||||
from evennia.utils.test_resources import EvenniaTest
|
||||
from evennia.commands.default import help, general, system, admin, account, building, batchprocess, comms
|
||||
from evennia.commands.default import help, general, system, admin, account, building, batchprocess, comms, unloggedin
|
||||
from evennia.commands.command import Command, InterruptCommand
|
||||
from evennia.utils import ansi, utils
|
||||
from evennia.utils import ansi, utils, gametime
|
||||
from evennia.server.sessionhandler import SESSIONS
|
||||
from evennia import search_object
|
||||
from evennia import DefaultObject, DefaultCharacter
|
||||
|
|
@ -433,3 +434,12 @@ class TestInterruptCommand(CommandTest):
|
|||
def test_interrupt_command(self):
|
||||
ret = self.call(CmdInterrupt(), "")
|
||||
self.assertEqual(ret, "")
|
||||
|
||||
|
||||
class TestUnconnectedCommand(CommandTest):
|
||||
def test_info_command(self):
|
||||
expected = "## BEGIN INFO 1.1\nName: %s\nUptime: %s\nConnected: %d\nVersion: Evennia %s\n## END INFO" % (
|
||||
settings.SERVERNAME,
|
||||
datetime.datetime.fromtimestamp(gametime.SERVER_START_TIME).ctime(),
|
||||
SESSIONS.account_count(), utils.get_evennia_version())
|
||||
self.call(unloggedin.CmdUnconnectedInfo(), "", expected)
|
||||
Loading…
Add table
Add a link
Reference in a new issue