Fix FormattedString test failure.
Initialize FormattedString().attributes to DEFAULT_ATTRIBUTES so all the attributes are always present. FormattedString is now a class, not a namedtuple instance.
This commit is contained in:
parent
9b6ca78866
commit
ef7b2b7eaf
1 changed files with 7 additions and 1 deletions
|
@ -43,7 +43,13 @@ except ImportError:
|
|||
from html.parser import HTMLParser
|
||||
|
||||
|
||||
FormattedString = namedtuple("FormattedString", ["text", "attributes"])
|
||||
class FormattedString:
|
||||
__slots__ = ("text", "attributes")
|
||||
|
||||
def __init__(self, text, attributes):
|
||||
self.attributes = DEFAULT_ATTRIBUTES.copy()
|
||||
self.attributes.update(attributes)
|
||||
self.text = text
|
||||
|
||||
|
||||
class Formatted(object):
|
||||
|
|
Loading…
Reference in a new issue