File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,11 +134,15 @@ def __str__(self):
134134
135135
136136class AllVersion (Version ):
137- pass
137+ @classmethod
138+ def is_valid (cls , string ):
139+ return string == "vers:all/*"
138140
139141
140142class NoneVersion (Version ):
141- pass
143+ @classmethod
144+ def is_valid (cls , string ):
145+ return string == "vers:none/*"
142146
143147
144148class GenericVersion (Version ):
Original file line number Diff line number Diff line change @@ -552,6 +552,11 @@ def test_version_range_all():
552552 all_vers = VersionRange .from_string ("vers:all/*" )
553553 assert all_vers .contains (Version ("1.2.3" ))
554554 assert PypiVersion ("2.0.3" ) in all_vers
555+ # test for invalid all range specification
556+ with pytest .raises (Exception ):
557+ VersionRange .from_string ("vers:all/>1.2.3" )
558+ with pytest .raises (Exception ):
559+ VersionRange .from_string ("vers:all/*|>1.2.3" )
555560
556561def test_version_range_none ():
557562 none_vers = VersionRange .from_string ("vers:none/*" )
You can’t perform that action at this time.
0 commit comments