diff --git a/matrix/_weechat.py b/matrix/_weechat.py index 54cbe37..346b67f 100644 --- a/matrix/_weechat.py +++ b/matrix/_weechat.py @@ -154,6 +154,12 @@ def buffer_set(*_, **__): return +def buffer_get_string(_ptr, property): + if property == "localvar_type": + return "channel" + return "" + + def nicklist_add_group(*_, **__): return diff --git a/tests/buffer_test.py b/tests/buffer_test.py new file mode 100644 index 0000000..e146ac5 --- /dev/null +++ b/tests/buffer_test.py @@ -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