def __init__(self, package, version):
        """Construct a new requirement.

        :param package: the package name.
        :param version: a semver compatible version specification.
        """
        self.package = package
        self.version = version
        if self.version and not re.match(r"[<=>~]", version[:2]):
            self.version = "=={}".format(self.version)
def test_validation_with_invalid_language_code_type_raise_exception(self):
        self.assertEqual(self.voiceover_application.language_code, 'en')
        self.voiceover_application.validate()

        self.voiceover_application.language_code = 1
        with self.assertRaisesRegex(
            utils.ValidationError, 'Expected language_code to be a string'
        ):
            self.voiceover_application.validate()