Fix unittests
This commit is contained in:
parent
bee7fa174d
commit
b571d6fdd4
2 changed files with 14 additions and 10 deletions
|
|
@ -798,7 +798,7 @@ from evennia.contrib import talking_npc
|
||||||
class TestTalkingNPC(CommandTest):
|
class TestTalkingNPC(CommandTest):
|
||||||
def test_talkingnpc(self):
|
def test_talkingnpc(self):
|
||||||
npc = create_object(talking_npc.TalkingNPC, key="npctalker", location=self.room1)
|
npc = create_object(talking_npc.TalkingNPC, key="npctalker", location=self.room1)
|
||||||
self.call(talking_npc.CmdTalk(), "", "(You walk up and talk to Char.)|")
|
self.call(talking_npc.CmdTalk(), "", "(You walk up and talk to Char.)")
|
||||||
npc.delete()
|
npc.delete()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -976,7 +976,11 @@ class EvMenu(object):
|
||||||
node (str): The formatted node to display.
|
node (str): The formatted node to display.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
screen_width = self._session.protocol_flags.get("SCREENWIDTH", {0: 78})[0]
|
if self._session:
|
||||||
|
screen_width = self._session.protocol_flags.get(
|
||||||
|
"SCREENWIDTH", {0: _MAX_TEXT_WIDTH})[0]
|
||||||
|
else:
|
||||||
|
screen_width = _MAX_TEXT_WIDTH
|
||||||
|
|
||||||
nodetext_width_max = max(m_len(line) for line in nodetext.split("\n"))
|
nodetext_width_max = max(m_len(line) for line in nodetext.split("\n"))
|
||||||
options_width_max = max(m_len(line) for line in optionstext.split("\n"))
|
options_width_max = max(m_len(line) for line in optionstext.split("\n"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue