Beispiel #1
0
    def test_beer_for_1(self, testbot):
        dialogtest(
            testbot,
            "!beer for asdil1991",
            "/me goes to the cellar and returns, carrying a beer \
for asdil1991.",
        )
Beispiel #2
0
    def test_beer_for_2(self, testbot):
        dialogtest(
            testbot,
            "!beer for asdil1991 and pheerai and asdil12 \
cool Büchenbacher",
            "/me goes to the cellar and returns, carrying a \
cool Büchenbacher beer for asdil1991 and pheerai and asdil12.",
        )
Beispiel #3
0
    def test_give_to(self, testbot):
        # give to 1 person
        dialogtest(testbot, "!give to asdil1991", "/me gives to asdil1991.")
        # Give to multiple persons
        dialogtest(
            testbot,
            "!give to asdil1991 and pheerai and asdil12 \
salty gulasch",
            "/me gives salty gulasch to asdil1991 and pheerai \
and asdil12.",
        )
Beispiel #4
0
    def test_beer_1(self, testbot):
        dialogtest(
            testbot,
            "!beer",
            "/me goes to the cellar and returns, carrying a beer \
for None.",
        )
        dialogtest(
            testbot,
            "!beer cool büchenbacher",
            "/me goes to the cellar and returns, carrying a cool \
büchenbacher beer for None.",
        )
Beispiel #5
0
 def test_cite_get(self, testbot):
     dialogtest(testbot,
                "!cite get",
                "Invalid usage. This command takes exactly one parameter")
     dialogtest(testbot, "!cite get 1", "Foo – Bar")
     dialogtest(testbot, "!cite get a", "This command takes one integer only")
     dialogtest(testbot, "!cite random", "Foo – Bar")
Beispiel #6
0
    def test_arch_maint(self, testbot):
        # No argument
        dialogtest(
            testbot,
            '!arch maint',
            'Please specify a keyword.'
        )
        # No Dialogtest, we want to map using in!
        testbot.push_message('!arch maint faidoc')
        expected = ' packages maintained by faidoc found.\n\
cinnamon'
        result = testbot.pop_message()
        assert expected in result
        # Single arg without match
        dialogtest(
            testbot,
            '!arch maint foobarbaz',
            'No packages maintained by foobarbaz found.'
        )
Beispiel #7
0
    def test_klug(self, testbot):
        # empty
        dialogtest(
            testbot,
            '!klug',
            'Du bist so Kluk! K – L – U – K!'
        )
        # 1 arg:
        # Random, thus "in"!
        testbot.push_message('!klug pheerai')
        expected = 'Kluges pheerai! Hier hast du '
        result = testbot.pop_message()
        assert expected in result
        # 2 args:
        dialogtest(
            testbot,
            '!klug pheerai asdil1991',
            "Meine kleinen Schaltkreise können so viel Intelligenz \
nicht verkraften!"
        )
Beispiel #8
0
    def test_aur_maint(self, testbot):
        # Missing argument
        dialogtest(
            testbot,
            '!aur maint',
            'Please specify a keyword.'
        )

        # Valid argument + result
        dialogtest(
            testbot,
            '!aur maint pheerai',
            '4 packages maintained by pheerai found.\n\
x32edit:    Remote control and programm Behringer X32 consoles\n\
python-pytest-pep8: pytest plugin to check PEP8 requirements.\n\
xprofile:   A tool to manage and automatically apply xrandr configurations.\n\
mergerfs:   Another FUSE union filesystem'
        )

        # Valid argument, no result
        dialogtest(
            testbot,
            '!aur maint foobarbaz',
            'No packages maintained by foobarbaz found.'
        )
Beispiel #9
0
    def test_pkg_search(self, testbot):
        dialogtest(
            testbot,
            '!pkg search',
            'Please specify a keyword.'
        )
        dialogtest(
            testbot,
            '!pkg search python-systemd',
            '2 matching packages found.\n\
extra/python-systemd:   Python bindings for systemd\n\
aur/python-systemd-git: Systemd python bindings'
        )
        dialogtest(
            testbot,
            '!pkg search foobarbaz',
            'Sorry, no matching packages found.'
        )
Beispiel #10
0
 def test_armer(self, testbot):
     # empty
     dialogtest(
         testbot,
         '!armer',
         'Oooh. Hast du dir weh getan?'
     )
     # Nick specified
     dialogtest(
         testbot,
         '!armer pheerai',
         'Armes pheerai. Brauchst du ein Taschentuch?'
     )
     # Several nicks:
     dialogtest(
         testbot,
         '!armer pheerai asdil1991',
         'Braucht ihr Mitleid? Ich könnte welches vortäuschen…'
     )
Beispiel #11
0
    def test_aur_info(self, testbot):
        # Missing argument
        dialogtest(
            testbot,
            '!aur info',
            'Please specify a keyword.'
        )

        # With valid argument
        dialogtest(
            testbot,
            '!aur info x32edit',
            'x32edit:    Remote control and programm \
Behringer X32 consoles'
        )

        # Valid argument, no result:
        dialogtest(
            testbot,
            '!aur info foobar_baz',
            'foobar_baz was not found, \
or something else went wrong. Sorry.'
        )
Beispiel #12
0
    def test_arch_info(self, testbot):
        # No argument
        dialogtest(
            testbot,
            '!arch info',
            'Please specify a keyword.'
        )

        # Valid Argument, hit
        dialogtest(
            testbot,
            '!arch info 0ad',
            'community/0ad:  Cross-platform, 3D and \
historically-based real-time strategy game'
        )

        # Valid Argument, no hit
        dialogtest(
            testbot,
            '!arch info foobarbaz',
            'foobarbaz was not found, or something \
else went wrong. Sorry.'
        )
Beispiel #13
0
    def test_aur_search(self, testbot):
        # Missing argument
        dialogtest(
            testbot,
            '!aur search',
            'Please specify a keyword.'
        )

        # Valid argument + result:
        dialogtest(
            testbot,
            '!aur search x32edit',
            '1 matching packages found.\n\
x32edit:    Remote control and programm \
Behringer X32 consoles'
        )

        # No search result:
        dialogtest(
            testbot,
            '!aur search foobarbaz',
            'No package matching your query found.'
        )
Beispiel #14
0
    def test_arch_search(self, testbot):
        # No Argument
        dialogtest(
            testbot,
            '!arch search',
            'Please specify a keyword.'
        )

        # Valid Argument, no hit
        dialogtest(
            testbot,
            '!arch search 0ad',
            # Using the Messages, \t gets replaced.
            "1 matching packages found.\n\
community/0ad:  Cross-platform, 3D and historically-based \
real-time strategy game"
        )

        # Valid arg, no result
        dialogtest(
            testbot,
            '!arch search foobarbaz',
            'No package matching your query found.'
        )
Beispiel #15
0
 def test_easy(self, testbot):
     dialogtest(
         testbot,
         '!easy',
         'Das war ja einfach…'
     )
Beispiel #16
0
 def test_give(self, testbot):
     dialogtest(testbot, "!give", "/me gives a to None.")
     dialogtest(testbot, "!give sweet chocolate", "/me gives a sweet chocolate to None.")
Beispiel #17
0
 def test_next(self, testbot):
     dialogtest(
         testbot,
         '!next',
         "Ein weiter zufriedener Kunde. NÄCHSTER!"
     )
Beispiel #18
0
 def test_haha(self, testbot):
     dialogtest(
         testbot,
         '!haha',
         'Ha-ha! (© Nelson Muntz)'
     )
Beispiel #19
0
 def test_cite_add(self, testbot):
     dialogtest(testbot, "!cite add", "Invalid usage. You must add a quote")
     dialogtest(testbot,
                "!cite add Foo\nBar",
                "Sucessfully added the quote")