def test_commandNameMustBeAByteString(self):
        """
        A L{Command} subclass cannot be defined with a C{commandName} that's
        not a byte string.
        """
        error = self.assertRaises(
            TypeError, type, "NewCommand", (amp.Command, ),
            {"commandName": u"FOO"})
        self.assertRegex(
            str(error), "^Command names must be byte strings, got: u?'FOO'$")

        A L{Command} subclass cannot be defined with a C{commandName} that's
        not a byte string.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_amp.py