Fix ordering of prototype diff output for test
This commit is contained in:
parent
e9fb17528d
commit
95c3adc163
2 changed files with 22 additions and 19 deletions
|
|
@ -2004,7 +2004,8 @@ def _format_diff_text_and_options(diff, **kwargs):
|
||||||
("diff", diff)), **kwargs))})
|
("diff", diff)), **kwargs))})
|
||||||
optnum += 1
|
optnum += 1
|
||||||
else:
|
else:
|
||||||
for key, subdiffpart in diffpart.items():
|
for key in sorted(list(diffpart.keys())):
|
||||||
|
subdiffpart = diffpart[key]
|
||||||
text, option, optnum = _parse_diffpart(
|
text, option, optnum = _parse_diffpart(
|
||||||
subdiffpart, optnum, *(args + (key, )))
|
subdiffpart, optnum, *(args + (key, )))
|
||||||
texts.extend(text)
|
texts.extend(text)
|
||||||
|
|
|
||||||
|
|
@ -400,6 +400,8 @@ class _MockMenu(object):
|
||||||
|
|
||||||
class TestMenuModule(EvenniaTest):
|
class TestMenuModule(EvenniaTest):
|
||||||
|
|
||||||
|
maxDiff = None
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestMenuModule, self).setUp()
|
super(TestMenuModule, self).setUp()
|
||||||
|
|
||||||
|
|
@ -583,31 +585,31 @@ class TestMenuModule(EvenniaTest):
|
||||||
'prelogout_location': (('prelogout_location', "#2", None, ''),
|
'prelogout_location': (('prelogout_location', "#2", None, ''),
|
||||||
('prelogout_location', "#2", None, ''),
|
('prelogout_location', "#2", None, ''),
|
||||||
'KEEP')},
|
'KEEP')},
|
||||||
'home': ('#2', '#2', 'KEEP'),
|
'home': ('#2', '#2', 'KEEP'),
|
||||||
'key': ('TestChar', 'TestChar', 'KEEP'),
|
'key': ('TestChar', 'TestChar', 'KEEP'),
|
||||||
'locks': ('boot:false();call:false();control:perm(Developer);delete:false();'
|
'locks': ('boot:false();call:false();control:perm(Developer);delete:false();'
|
||||||
'edit:false();examine:perm(Developer);get:false();msg:all();'
|
'edit:false();examine:perm(Developer);get:false();msg:all();'
|
||||||
'puppet:false();tell:perm(Admin);view:all()',
|
'puppet:false();tell:perm(Admin);view:all()',
|
||||||
'boot:false();call:false();control:perm(Developer);delete:false();'
|
'boot:false();call:false();control:perm(Developer);delete:false();'
|
||||||
'edit:false();examine:perm(Developer);get:false();msg:all();'
|
'edit:false();examine:perm(Developer);get:false();msg:all();'
|
||||||
'puppet:false();tell:perm(Admin);view:all()',
|
'puppet:false();tell:perm(Admin);view:all()',
|
||||||
'KEEP'),
|
'KEEP'),
|
||||||
'permissions': {'developer': ('developer', 'developer', 'KEEP')},
|
'permissions': {'developer': ('developer', 'developer', 'KEEP')},
|
||||||
'prototype_desc': ('Testobject build', None, 'REMOVE'),
|
'prototype_desc': ('Testobject build', None, 'REMOVE'),
|
||||||
'prototype_key': ('TestDiffKey', 'TestDiffKey', 'KEEP'),
|
'prototype_key': ('TestDiffKey', 'TestDiffKey', 'KEEP'),
|
||||||
'prototype_locks': ('spawn:all();edit:all()', 'spawn:all();edit:all()', 'KEEP'),
|
'prototype_locks': ('spawn:all();edit:all()', 'spawn:all();edit:all()', 'KEEP'),
|
||||||
'prototype_tags': {},
|
'prototype_tags': {},
|
||||||
'tags': {'foo': (None, ('foo', None, ''), 'ADD')},
|
'tags': {'foo': (None, ('foo', None, ''), 'ADD')},
|
||||||
'typeclass': ('typeclasses.characters.Character',
|
'typeclass': ('typeclasses.characters.Character',
|
||||||
'typeclasses.characters.Character', 'KEEP')}
|
'typeclasses.characters.Character', 'KEEP')}
|
||||||
|
|
||||||
texts, options = olc_menus._format_diff_text_and_options(obj_diff)
|
texts, options = olc_menus._format_diff_text_and_options(obj_diff)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
"\n".join(texts),
|
"\n".join(texts),
|
||||||
'- |wattrs:|n \n'
|
'- |wattrs:|n \n'
|
||||||
|
' |gKEEP|W:|n desc |W=|n This is User #1. |W(category:|n None|W, locks:|n |W)|n\n'
|
||||||
' |c[1] |yADD|n|W:|n None |W->|n foo |W=|n bar |W(category:|n None|W, locks:|n |W)|n\n'
|
' |c[1] |yADD|n|W:|n None |W->|n foo |W=|n bar |W(category:|n None|W, locks:|n |W)|n\n'
|
||||||
' |gKEEP|W:|n prelogout_location |W=|n #2 |W(category:|n None|W, locks:|n |W)|n\n'
|
' |gKEEP|W:|n prelogout_location |W=|n #2 |W(category:|n None|W, locks:|n |W)|n\n'
|
||||||
' |gKEEP|W:|n desc |W=|n This is User #1. |W(category:|n None|W, locks:|n |W)|n\n'
|
|
||||||
'- |whome:|n |gKEEP|W:|n #2\n'
|
'- |whome:|n |gKEEP|W:|n #2\n'
|
||||||
'- |wkey:|n |gKEEP|W:|n TestChar\n'
|
'- |wkey:|n |gKEEP|W:|n TestChar\n'
|
||||||
'- |wlocks:|n |gKEEP|W:|n boot:false();call:false();control:perm(Developer);delete:false();edit:false();examine:perm(Developer);get:false();msg:all();puppet:false();tell:perm(Admin);view:all()\n'
|
'- |wlocks:|n |gKEEP|W:|n boot:false();call:false();control:perm(Developer);delete:false();edit:false();examine:perm(Developer);get:false();msg:all();puppet:false();tell:perm(Admin);view:all()\n'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue