Skip to content

Commit 843c31c

Browse files
committed
Add specifier tests
1 parent e84e341 commit 843c31c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_specifiers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ def test_comparison_non_specifier(self):
328328
("2.0.post1", ">=2"),
329329
("2.0.post1.dev1", ">=2"),
330330
("3", ">=2"),
331+
("3.0.0a8", ">=3.0.0a7"),
331332
# Test the less than equal operation
332333
("2.0", "<=2"),
333334
("2.0", "<=2.0"),
@@ -341,16 +342,19 @@ def test_comparison_non_specifier(self):
341342
("2.0c1.post1.dev1", "<=2"),
342343
("2.0rc1", "<=2"),
343344
("1", "<=2"),
345+
("3.0.0a7", "<=3.0.0a8"),
344346
# Test the greater than operation
345347
("3", ">2"),
346348
("2.1", ">2.0"),
347349
("2.0.1", ">2"),
348350
("2.1.post1", ">2"),
349351
("2.1+local.version", ">2"),
352+
("3.0.0a8", ">3.0.0a7"),
350353
# Test the less than operation
351354
("1", "<2"),
352355
("2.0", "<2.1"),
353356
("2.0.dev0", "<2.1"),
357+
("3.0.0a7", "<3.0.0a8"),
354358
# Test the compatibility operation
355359
("1", "~=1.0"),
356360
("1.0.1", "~=1.0"),
@@ -560,6 +564,11 @@ def test_specifiers_prereleases(self, specifier, version, expected):
560564
(">=1.0", None, ["2.0a1"], ["2.0a1"]),
561565
(">=1.0.dev1", None, ["1.0", "2.0a1"], ["1.0", "2.0a1"]),
562566
(">=1.0.dev1", False, ["1.0", "2.0a1"], ["1.0"]),
567+
("!=2.0a1", None, ["1.0a2", "1.0", "2.0a1"], ["1.0"]),
568+
("==2.0a1", None, ["2.0a1"], ["2.0a1"]),
569+
(">2.0a1", None, ["2.0a1", "3.0a2", "3.0"], ["3.0a2", "3.0"]),
570+
("<2.0a1", None, ["1.0a2", "1.0", "2.0a1"], ["1.0a2", "1.0"]),
571+
("~=2.0a1", None, ["1.0", "2.0a1", "3.0a2", "3.0"], ["2.0a1"]),
563572
],
564573
)
565574
def test_specifier_filter(self, specifier, prereleases, input, expected):

0 commit comments

Comments
 (0)