Пример #1
0
    def test_clapify_command(self):
        """Test `+clapify`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        self.assertEqual(
            handle_common_commands(["I", "love", "dogs"], "clapify"),
            "I :clap: love :clap: dogs",
        )
Пример #2
0
    def test_pi_command(self):
        """Test `+pi`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        self.assertEqual(
            handle_common_commands([], "pi"),
            "3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709",
        )
Пример #3
0
    def test_joke_command(self):
        """Test `+joke`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        self.assertIsInstance(
            handle_common_commands([], "joke", None).message,
            str,
            "Returned message field was not a string.",
        )
Пример #4
0
    def test_say_command(self):
        """Test `+say`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        self.assertEqual(
            handle_common_commands(
                ["hello", "world", "this", "should", "be", "said", "yay"],
                "say",
            ),
            "hello world this should be said yay",
        )
Пример #5
0
    def test_coinflip_command(self):
        """Test `+coinflip`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        i = 0
        while i < 30:
            self.assertIn(
                handle_common_commands([], "coinflip"),
                ["**Heads**.", "**Tails**."],
            )
            i = i + 1
Пример #6
0
    def test_8_command(self):
        """Test `+8`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        i = 0
        while i < 30:
            self.assertIsInstance(
                handle_common_commands(["why", "is", "earth", "not", "flat?"],
                                       "8"),
                str,
            )
            i = i + 1
Пример #7
0
    def test_8_command(self):
        """Test `+8`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        i = 0
        while i < 30:
            self.assertIsInstance(
                handle_common_commands(
                    ["why", "is", "earth", "not", "flat?"],
                    "8",
                    None,
                ).message,
                str,
                "Returned message field was not a string.",
            )
            i = i + 1
Пример #8
0
    def test_joke_command(self):
        """Test `+joke`."""

        from cakebot.TextCommandsUtil import handle_common_commands

        self.assertIsInstance(handle_common_commands([], "joke"), str)