From 2ab99ee1bf97f2f4bc715340f0bd6478e7677175 Mon Sep 17 00:00:00 2001 From: Rachel Blackman Date: Sun, 1 Apr 2018 00:39:16 -0700 Subject: [PATCH] Add test for unconnected commands, add INFO command to test set. --- evennia/commands/default/tests.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/evennia/commands/default/tests.py b/evennia/commands/default/tests.py index 41654077a4..a645014482 100644 --- a/evennia/commands/default/tests.py +++ b/evennia/commands/default/tests.py @@ -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) \ No newline at end of file