diff --git a/cpe/comp/cpecomp2_3.py b/cpe/comp/cpecomp2_3.py index bb8e133..a2042ba 100644 --- a/cpe/comp/cpecomp2_3.py +++ b/cpe/comp/cpecomp2_3.py @@ -262,7 +262,7 @@ def _is_valid_part(self): return super(CPEComponent2_3, self)._is_valid_part() # Compilation of regular expression associated with value of part - part_pattern = "^(\{0}|\{1})$".format(self.WILDCARD_ONE, + part_pattern = r"^(\{0}|\{1})$".format(self.WILDCARD_ONE, self.WILDCARD_MULTI) part_rxc = re.compile(part_pattern) diff --git a/cpe/comp/cpecomp2_3_uri.py b/cpe/comp/cpecomp2_3_uri.py index 46480c3..e6ba1b3 100644 --- a/cpe/comp/cpecomp2_3_uri.py +++ b/cpe/comp/cpecomp2_3_uri.py @@ -48,7 +48,7 @@ class CPEComponent2_3_URI(CPEComponent2_3): # Patterns used to check the value of component _PCT_ENCODED = "%21|%22|%23|%24|%25|%26|%27|%28|%29|%2a|%2b|%2c|%2f|%3a|%3b|%3c|%3d|%3e|%3f|%40|%5b|%5c|%5d|%5e|%60|%7b|%7c|%7d|%7e" _SPEC_CHRS = "((%01)+|%02)" - _UNRESERVED = "[\w\-\.]" + _UNRESERVED = r"[\w\-\.]" #: Separator of components of CPE name with URI style SEPARATOR_COMP = ":" diff --git a/cpe/comp/cpecomp_simple.py b/cpe/comp/cpecomp_simple.py index ae306ce..c0d1b43 100644 --- a/cpe/comp/cpecomp_simple.py +++ b/cpe/comp/cpecomp_simple.py @@ -45,10 +45,10 @@ class CPEComponentSimple(CPEComponent): ############### #: Pattern to check if a character is a alphanumeric or underscore - _ALPHANUM_PATTERN = "\w" + _ALPHANUM_PATTERN = r"\w" #: Pattern to check the value of language component of CPE name - _LANGTAG_PATTERN = "^([a-z]{2,3}(-([a-z]{2}|[\d]{3}))?)$" + _LANGTAG_PATTERN = r"^([a-z]{2,3}(-([a-z]{2}|[\d]{3}))?)$" #: Pattern to check the value of part component of CPE name _PART_PATTERN = "^(h|o|a)$" diff --git a/tests/unit/test_cpe.py b/tests/unit/test_cpe.py index 6c323a4..91c5589 100644 --- a/tests/unit/test_cpe.py +++ b/tests/unit/test_cpe.py @@ -241,11 +241,11 @@ def test_equals(self): the equivalent WFN string. """ - self.assertEquals(self.c11, self.c22) - self.assertEquals(self.c22, self.c11) - self.assertEquals(self.c11, self.c23_wfn) - self.assertEquals(self.c11, self.c23_fs) - self.assertEquals(self.c23_uri, self.c23_fs) + self.assertEqual(self.c11, self.c22) + self.assertEqual(self.c22, self.c11) + self.assertEqual(self.c11, self.c23_wfn) + self.assertEqual(self.c11, self.c23_fs) + self.assertEqual(self.c23_uri, self.c23_fs) @pytest.mark.skip(reason="currently broken") def test_incompatible_versions(self):