def METHOD_NAME(self):
    prefix = "prefix-too-long"
    for i in range(4):
        with self.assertRaises(ValueError) as cm:
            create_random_name(prefix, length=len(prefix) + i)
        self.assertEqual(
            str(cm.exception),
            "The randomized part of the name is shorter than 4, which may not be "
            "able to offer enough randomness",
        )