File: test.py

package info (click to toggle)
errbot 6.2.0%2Bds-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,848 kB
  • sloc: python: 11,573; makefile: 162; sh: 97
file content (21 lines) | stat: -rw-r--r-- 590 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import absolute_import

from errbot import BotPlugin, arg_botcmd, botcmd, re_botcmd


class Test(BotPlugin):
    @botcmd
    def test_template1(self, msg, args):
        self.send_templated(msg.frm, "test", {"variable": "ok"})

    @botcmd(template="test")
    def test_template2(self, msg, args):
        return {"variable": "ok"}

    @botcmd(template="test")
    def test_template3(self, msg, args):
        yield {"variable": "ok"}

    @arg_botcmd("my_var", type=str, template="test")
    def test_template4(self, msg, my_var=None):
        return {"variable": my_var}