def test_booleanValues(self):
        """
        Verify that the Boolean parser parses 'True' and 'False', but nothing
        else.
        """
        b = amp.Boolean()
        self.assertTrue(b.fromString(b"True"))
        self.assertFalse(b.fromString(b"False"))
        self.assertRaises(TypeError, b.fromString, b"ninja")
        self.assertRaises(TypeError, b.fromString, b"true")
        self.assertRaises(TypeError, b.fromString, b"TRUE")
        self.assertEqual(b.toString(True), b'True')
        self.assertEqual(b.toString(False), b'False')

        Verify that the Boolean parser parses 'True' and 'False', but nothing
        else.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_amp.py