Resolve unittests

This commit is contained in:
Griatch 2018-08-12 13:37:19 +02:00
parent 6cf6476417
commit 7dec566926
2 changed files with 3 additions and 5 deletions

View file

@ -187,7 +187,6 @@ class TestProtLib(EvenniaTest):
def test_prototype_to_str(self):
prstr = protlib.prototype_to_str(self.prot)
print("prst: {}".format(prstr))
self.assertTrue(prstr.startswith("|cprototype-key:|n"))
def test_check_permission(self):

View file

@ -7,7 +7,6 @@ be of use when designing your own game.
"""
from __future__ import division, print_function
import itertools
from builtins import object, range
from future.utils import viewkeys, raise_
@ -233,10 +232,10 @@ def justify(text, width=None, align="f", indent=0):
pad = " " * (line_rest // 2)
line[0] = pad + line[0]
if line[-1] == "\n\n":
line[-1] = line[-1] + pad + " " * (line_rest % 2)
else:
line[-1] = pad + " " * (line_rest % 2 - 1) + \
line[-1] += pad + " " * (line_rest % 2 - 1) + \
"\n" + " " * width + "\n" + " " * width
else:
line[-1] = line[-1] + pad + " " * (line_rest % 2)
else: # align 'f'
gap += " " * (line_rest // max(1, ngaps))
rest_gap = line_rest % max(1, ngaps)