Merge branch 'pr-17' into olm-command
This commit is contained in:
commit
f1e96f7a28
3 changed files with 29 additions and 1 deletions
|
@ -154,6 +154,12 @@ def buffer_set(*_, **__):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def buffer_get_string(_ptr, property):
|
||||||
|
if property == "localvar_type":
|
||||||
|
return "channel"
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def nicklist_add_group(*_, **__):
|
def nicklist_add_group(*_, **__):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,13 @@ except ImportError:
|
||||||
from html.parser import HTMLParser
|
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):
|
class Formatted(object):
|
||||||
|
|
16
tests/buffer_test.py
Normal file
16
tests/buffer_test.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from matrix.buffer import WeechatChannelBuffer
|
||||||
|
|
||||||
|
|
||||||
|
class TestClass(object):
|
||||||
|
def test_buffer(self):
|
||||||
|
b = WeechatChannelBuffer("test_buffer_name", "example.org", "alice")
|
||||||
|
assert b
|
||||||
|
|
||||||
|
def test_buffer_print(self):
|
||||||
|
b = WeechatChannelBuffer("test_buffer_name", "example.org", "alice")
|
||||||
|
b.message("alice", "hello world", 0, 0)
|
||||||
|
assert b
|
Loading…
Add table
Reference in a new issue