Merge with develop and fix merge conflicts
This commit is contained in:
commit
72f4fedcbe
148 changed files with 20005 additions and 2718 deletions
|
|
@ -6,6 +6,7 @@ Test form
|
|||
FORMCHAR = "x"
|
||||
TABLECHAR = "c"
|
||||
|
||||
|
||||
FORM = """
|
||||
.------------------------------------------------.
|
||||
| |
|
||||
|
|
@ -27,4 +28,6 @@ FORM = """
|
|||
| ccccccccc | ccccccccccccccccBccccccccccccccccc |
|
||||
| | |
|
||||
-----------`-------------------------------------
|
||||
Footer: xxxFxxx
|
||||
info
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -10,44 +10,47 @@ class TestEvForm(TestCase):
|
|||
def test_form(self):
|
||||
self.maxDiff = None
|
||||
self.assertEqual(evform._test(),
|
||||
'.------------------------------------------------.\n'
|
||||
'| |\n'
|
||||
'| Name: \x1b[0m\x1b[1m\x1b[32mTom\x1b[1m\x1b[32m \x1b'
|
||||
'[1m\x1b[32mthe\x1b[1m\x1b[32m \x1b[0m \x1b[0m '
|
||||
'Account: \x1b[0m\x1b[1m\x1b[33mGriatch '
|
||||
'\x1b[0m\x1b[0m\x1b[1m\x1b[32m\x1b[1m\x1b[32m\x1b[1m\x1b[32m\x1b[1m\x1b[32m\x1b[0m\x1b[0m '
|
||||
'|\n'
|
||||
'| \x1b[0m\x1b[1m\x1b[32mBouncer\x1b[0m \x1b[0m |\n'
|
||||
'| |\n'
|
||||
' >----------------------------------------------<\n'
|
||||
'| |\n'
|
||||
'| Desc: \x1b[0mA sturdy \x1b[0m \x1b[0m'
|
||||
' STR: \x1b[0m12 \x1b[0m\x1b[0m\x1b[0m\x1b[0m'
|
||||
' DEX: \x1b[0m10 \x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
'| \x1b[0mfellow\x1b[0m \x1b[0m'
|
||||
' INT: \x1b[0m5 \x1b[0m\x1b[0m\x1b[0m\x1b[0m'
|
||||
' STA: \x1b[0m18 \x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
'| \x1b[0m \x1b[0m'
|
||||
' LUC: \x1b[0m10 \x1b[0m\x1b[0m\x1b[0m'
|
||||
' MAG: \x1b[0m3 \x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
'| |\n'
|
||||
' >----------.-----------------------------------<\n'
|
||||
'| | |\n'
|
||||
'| \x1b[0mHP\x1b[0m|\x1b[0mMV \x1b[0m|\x1b[0mMP\x1b[0m '
|
||||
'| \x1b[0mSkill \x1b[0m|\x1b[0mValue \x1b[0m'
|
||||
'|\x1b[0mExp \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
'| ~~+~~~+~~ | ~~~~~~~~~~~+~~~~~~~~~~+~~~~~~~~~~~ |\n'
|
||||
'| \x1b[0m**\x1b[0m|\x1b[0m***\x1b[0m\x1b[0m|\x1b[0m**\x1b[0m\x1b[0m '
|
||||
'| \x1b[0mShooting \x1b[0m|\x1b[0m12 \x1b[0m'
|
||||
'|\x1b[0m550/1200 \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
'| \x1b[0m \x1b[0m|\x1b[0m**\x1b[0m \x1b[0m|\x1b[0m*\x1b[0m \x1b[0m '
|
||||
'| \x1b[0mHerbalism \x1b[0m|\x1b[0m14 \x1b[0m'
|
||||
'|\x1b[0m990/1400 \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
'| \x1b[0m \x1b[0m|\x1b[0m \x1b[0m|\x1b[0m \x1b[0m '
|
||||
'| \x1b[0mSmithing \x1b[0m|\x1b[0m9 \x1b[0m'
|
||||
'|\x1b[0m205/900 \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
'| | |\n'
|
||||
' -----------`-------------------------------------\n')
|
||||
u'.------------------------------------------------.\n'
|
||||
u'| |\n'
|
||||
u'| Name: \x1b[0m\x1b[1m\x1b[32mTom\x1b[1m\x1b[32m \x1b'
|
||||
u'[1m\x1b[32mthe\x1b[1m\x1b[32m \x1b[0m \x1b[0m '
|
||||
u'Account: \x1b[0m\x1b[1m\x1b[33mGriatch '
|
||||
u'\x1b[0m\x1b[0m\x1b[1m\x1b[32m\x1b[1m\x1b[32m\x1b[1m\x1b[32m\x1b[1m\x1b[32m\x1b[0m\x1b[0m '
|
||||
u'|\n'
|
||||
u'| \x1b[0m\x1b[1m\x1b[32mBouncer\x1b[0m \x1b[0m |\n'
|
||||
u'| |\n'
|
||||
u' >----------------------------------------------< \n'
|
||||
u'| |\n'
|
||||
u'| Desc: \x1b[0mA sturdy \x1b[0m \x1b[0m'
|
||||
u' STR: \x1b[0m12 \x1b[0m\x1b[0m\x1b[0m\x1b[0m'
|
||||
u' DEX: \x1b[0m10 \x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
u'| \x1b[0mfellow\x1b[0m \x1b[0m'
|
||||
u' INT: \x1b[0m5 \x1b[0m\x1b[0m\x1b[0m\x1b[0m'
|
||||
u' STA: \x1b[0m18 \x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
u'| \x1b[0m \x1b[0m'
|
||||
u' LUC: \x1b[0m10 \x1b[0m\x1b[0m\x1b[0m'
|
||||
u' MAG: \x1b[0m3 \x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
u'| |\n'
|
||||
u' >----------.-----------------------------------< \n'
|
||||
u'| | |\n'
|
||||
u'| \x1b[0mHP\x1b[0m|\x1b[0mMV \x1b[0m|\x1b[0mMP\x1b[0m '
|
||||
u'| \x1b[0mSkill \x1b[0m|\x1b[0mValue \x1b[0m'
|
||||
u'|\x1b[0mExp \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
u'| ~~+~~~+~~ | ~~~~~~~~~~~+~~~~~~~~~~+~~~~~~~~~~~ |\n'
|
||||
u'| \x1b[0m**\x1b[0m|\x1b[0m***\x1b[0m\x1b[0m|\x1b[0m**\x1b[0m\x1b[0m '
|
||||
u'| \x1b[0mShooting \x1b[0m|\x1b[0m12 \x1b[0m'
|
||||
u'|\x1b[0m550/1200 \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
u'| \x1b[0m \x1b[0m|\x1b[0m**\x1b[0m \x1b[0m|\x1b[0m*\x1b[0m \x1b[0m '
|
||||
u'| \x1b[0mHerbalism \x1b[0m|\x1b[0m14 \x1b[0m'
|
||||
u'|\x1b[0m990/1400 \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
u'| \x1b[0m \x1b[0m|\x1b[0m \x1b[0m|\x1b[0m \x1b[0m '
|
||||
u'| \x1b[0mSmithing \x1b[0m|\x1b[0m9 \x1b[0m'
|
||||
u'|\x1b[0m205/900 \x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m\x1b[0m |\n'
|
||||
u'| | |\n'
|
||||
u' -----------`-------------------------------------\n'
|
||||
u' Footer: \x1b[0mrev 1 \x1b[0m \n'
|
||||
u' info \n'
|
||||
u' ')
|
||||
|
||||
def test_ansi_escape(self):
|
||||
# note that in a msg() call, the result would be the correct |-----,
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class TestEvMenu(TestCase):
|
|||
|
||||
def _debug_output(self, indent, msg):
|
||||
if self.debug_output:
|
||||
print((" " * indent + msg))
|
||||
print(" " * indent + ansi.strip_ansi(msg))
|
||||
|
||||
def _test_menutree(self, menu):
|
||||
"""
|
||||
|
|
@ -82,6 +82,8 @@ class TestEvMenu(TestCase):
|
|||
self.assertIsNotNone(
|
||||
bool(node_text),
|
||||
"node: {}: node-text is None, which was not expected.".format(nodename))
|
||||
if isinstance(node_text, tuple):
|
||||
node_text, helptext = node_text
|
||||
node_text = ansi.strip_ansi(node_text.strip())
|
||||
self.assertTrue(
|
||||
node_text.startswith(compare_text),
|
||||
|
|
@ -168,6 +170,7 @@ class TestEvMenu(TestCase):
|
|||
self.caller2.msg = MagicMock()
|
||||
self.session = MagicMock()
|
||||
self.session2 = MagicMock()
|
||||
|
||||
self.menu = evmenu.EvMenu(self.caller, self.menutree, startnode=self.startnode,
|
||||
cmdset_mergetype=self.cmdset_mergetype,
|
||||
cmdset_priority=self.cmdset_priority,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue