v440 2.0.0.dev30__tar.gz → 2.0.0.dev32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {v440-2.0.0.dev30/src/v440.egg-info → v440-2.0.0.dev32}/PKG-INFO +1 -1
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/pyproject.toml +1 -1
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/tests/test_testdata.py +27 -54
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/tests/test_version.py +43 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32/src/v440.egg-info}/PKG-INFO +1 -1
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/LICENSE.txt +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/MANIFEST.in +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/README.rst +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/setup.cfg +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/__init__.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/BaseList.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/Cfg.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/Digest.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/Pattern.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/SimpleQualifierParser.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/SlotList.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/VList.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/__init__.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/cfg.toml +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/qualparse.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/_utils/utils.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/Base.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/Local.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/Public.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/Qualification.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/Release.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/Version.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/VersionError.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/core/__init__.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/tests/__init__.py +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440/tests/testdata.toml +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440.egg-info/SOURCES.txt +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440.egg-info/dependency_links.txt +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440.egg-info/requires.txt +0 -0
- {v440-2.0.0.dev30 → v440-2.0.0.dev32}/src/v440.egg-info/top_level.txt +0 -0
|
@@ -8,7 +8,6 @@ from typing import *
|
|
|
8
8
|
|
|
9
9
|
import iterprod
|
|
10
10
|
import packaging.version
|
|
11
|
-
from catchlib import Catcher
|
|
12
11
|
|
|
13
12
|
from v440.core.Release import Release
|
|
14
13
|
from v440.core.Version import Version
|
|
@@ -78,11 +77,11 @@ class TestVersionLocalVersionError(unittest.TestCase):
|
|
|
78
77
|
k: str
|
|
79
78
|
v: dict
|
|
80
79
|
for k, v in Util.util.data["local_VersionError"].items():
|
|
81
|
-
self.
|
|
80
|
+
with self.subTest(key=k):
|
|
81
|
+
self.go(**v)
|
|
82
82
|
|
|
83
83
|
def go(
|
|
84
84
|
self: Self,
|
|
85
|
-
key: str,
|
|
86
85
|
query: list,
|
|
87
86
|
) -> None:
|
|
88
87
|
version: Version = Version()
|
|
@@ -141,36 +140,6 @@ class TestVersionEpochGo(unittest.TestCase):
|
|
|
141
140
|
self.assertEqual(v.epoch, part, msg=msg)
|
|
142
141
|
|
|
143
142
|
|
|
144
|
-
class TestSlicingNoGo(unittest.TestCase):
|
|
145
|
-
|
|
146
|
-
def test_slicing_2(self: Self) -> None:
|
|
147
|
-
v: Version = Version("1.2.3.4.5.6.7.8.9.10")
|
|
148
|
-
catcher: Catcher = Catcher()
|
|
149
|
-
with catcher.catch(Exception):
|
|
150
|
-
v.public.base.release[-8:15:5] = 777
|
|
151
|
-
self.assertNotEqual(catcher.caught, None)
|
|
152
|
-
|
|
153
|
-
def test_slicing_7(self: Self) -> None:
|
|
154
|
-
# test_slicing_7
|
|
155
|
-
v: Version = Version("1.2.3.4.5.6.7.8.9.10")
|
|
156
|
-
del v.public.base.release[-8:15:5]
|
|
157
|
-
self.assertEqual(str(v), "1.2.4.5.6.7.9.10")
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
class TestDevNoGo(unittest.TestCase):
|
|
161
|
-
|
|
162
|
-
def test_initial_none_dev(self: Self) -> None:
|
|
163
|
-
v: Version = Version("1.2.3")
|
|
164
|
-
self.assertEqual(str(v), "1.2.3")
|
|
165
|
-
self.assertIsNone(v.public.qualification.dev)
|
|
166
|
-
|
|
167
|
-
def test_dev_as_none(self: Self) -> None:
|
|
168
|
-
v: Version = Version("1.2.3")
|
|
169
|
-
v.public.qualification.dev = None
|
|
170
|
-
self.assertEqual(str(v), "1.2.3")
|
|
171
|
-
self.assertIsNone(v.public.qualification.dev)
|
|
172
|
-
|
|
173
|
-
|
|
174
143
|
class TestSlicingGo(unittest.TestCase):
|
|
175
144
|
def test_slicing_3(self: Self) -> None:
|
|
176
145
|
sli: dict = Util.util.data["slicingmethod"]
|
|
@@ -259,45 +228,43 @@ class TestDevGo(unittest.TestCase):
|
|
|
259
228
|
self.assertEqual(v.public.qualification.dev, v_ans, msg=msg)
|
|
260
229
|
|
|
261
230
|
|
|
262
|
-
class
|
|
263
|
-
|
|
264
|
-
def test_version_with_invalid_specifiers(self: Self) -> None:
|
|
265
|
-
# Test version with invalid specifiers that should raise an error
|
|
266
|
-
with self.assertRaises(VersionError):
|
|
267
|
-
Version("1.2.3--4")
|
|
268
|
-
|
|
269
|
-
with self.assertRaises(VersionError):
|
|
270
|
-
Version("1.2.3a1--4")
|
|
231
|
+
class TestVersionSpecifiersGo(unittest.TestCase):
|
|
271
232
|
|
|
272
233
|
def test_spec_toml(self: Self) -> None:
|
|
273
234
|
k: str
|
|
274
235
|
v: dict
|
|
275
236
|
for k, v in Util.util.data["spec"].items():
|
|
276
|
-
self.
|
|
237
|
+
self.go(**v, key=k)
|
|
277
238
|
|
|
278
|
-
def
|
|
239
|
+
def go(self: Self, string_a: str, string_b: str, key: str = "") -> None:
|
|
279
240
|
msg: str = "spec %r" % key
|
|
280
241
|
version: Version = Version(string_a)
|
|
281
242
|
self.assertEqual(str(version), string_b, msg=msg)
|
|
282
243
|
|
|
283
244
|
|
|
284
|
-
class
|
|
245
|
+
class TestPackagingA(unittest.TestCase):
|
|
285
246
|
def test_strings_a(self: Self) -> None:
|
|
286
|
-
a: packaging.version.Version
|
|
287
|
-
b: str
|
|
288
|
-
f: int
|
|
289
|
-
g: str
|
|
290
247
|
s: str
|
|
291
248
|
x: str
|
|
292
249
|
y: list
|
|
293
250
|
for x, y in Util.util.data["strings"]["valid"].items():
|
|
294
251
|
for s in y:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
252
|
+
with self.subTest(key=x):
|
|
253
|
+
self.go(text=s)
|
|
254
|
+
|
|
255
|
+
def go(self: Self, text: str) -> None:
|
|
256
|
+
a: packaging.version.Version
|
|
257
|
+
b: str
|
|
258
|
+
f: int
|
|
259
|
+
g: str
|
|
260
|
+
a = packaging.version.Version(text)
|
|
261
|
+
b = str(a)
|
|
262
|
+
f = len(a.release)
|
|
263
|
+
g = Version(text).format(f)
|
|
264
|
+
self.assertEqual(b, g)
|
|
300
265
|
|
|
266
|
+
|
|
267
|
+
class TestPackagingB(unittest.TestCase):
|
|
301
268
|
def test_strings_b(self: Self) -> None:
|
|
302
269
|
a: packaging.version.Version
|
|
303
270
|
b: packaging.version.Version
|
|
@@ -312,6 +279,8 @@ class TestPackaging(unittest.TestCase):
|
|
|
312
279
|
msg = f"{s} should match packaging.version.Version"
|
|
313
280
|
self.assertEqual(a, b, msg=msg)
|
|
314
281
|
|
|
282
|
+
|
|
283
|
+
class TestPackagingC(unittest.TestCase):
|
|
315
284
|
def test_strings_c(self: Self) -> None:
|
|
316
285
|
pure: list = list()
|
|
317
286
|
l: list
|
|
@@ -343,6 +312,8 @@ class TestPackaging(unittest.TestCase):
|
|
|
343
312
|
msg = f"{op} should match for {x!r} and {y!r}"
|
|
344
313
|
self.assertEqual(native, convert, msg=msg)
|
|
345
314
|
|
|
315
|
+
|
|
316
|
+
class TestPackagingField(unittest.TestCase):
|
|
346
317
|
def test_field(self: Self) -> None:
|
|
347
318
|
versionable: list = list()
|
|
348
319
|
l: list
|
|
@@ -369,6 +340,8 @@ class TestPackaging(unittest.TestCase):
|
|
|
369
340
|
version_obj.local = v.packaging().local
|
|
370
341
|
self.assertEqual(str(v.local), str(version_obj.local))
|
|
371
342
|
|
|
343
|
+
|
|
344
|
+
class TestPackagingExc(unittest.TestCase):
|
|
372
345
|
def test_exc_pack(self: Self) -> None:
|
|
373
346
|
impure: list = list()
|
|
374
347
|
l: list
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import unittest
|
|
2
2
|
from typing import *
|
|
3
3
|
|
|
4
|
+
from catchlib import Catcher
|
|
5
|
+
|
|
4
6
|
from v440.core.Qualification import Qualification
|
|
5
7
|
from v440.core.Version import Version
|
|
6
8
|
from v440.core.VersionError import VersionError
|
|
@@ -396,5 +398,46 @@ class TestVersionLocal(unittest.TestCase):
|
|
|
396
398
|
self.assertEqual(result, [1, "dev", "build"])
|
|
397
399
|
|
|
398
400
|
|
|
401
|
+
class TestSlicingNoGo(unittest.TestCase):
|
|
402
|
+
|
|
403
|
+
def test_slicing_2(self: Self) -> None:
|
|
404
|
+
v: Version = Version("1.2.3.4.5.6.7.8.9.10")
|
|
405
|
+
catcher: Catcher = Catcher()
|
|
406
|
+
with catcher.catch(Exception):
|
|
407
|
+
v.public.base.release[-8:15:5] = 777
|
|
408
|
+
self.assertNotEqual(catcher.caught, None)
|
|
409
|
+
|
|
410
|
+
def test_slicing_7(self: Self) -> None:
|
|
411
|
+
# test_slicing_7
|
|
412
|
+
v: Version = Version("1.2.3.4.5.6.7.8.9.10")
|
|
413
|
+
del v.public.base.release[-8:15:5]
|
|
414
|
+
self.assertEqual(str(v), "1.2.4.5.6.7.9.10")
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
class TestDevNoGo(unittest.TestCase):
|
|
418
|
+
|
|
419
|
+
def test_initial_none_dev(self: Self) -> None:
|
|
420
|
+
v: Version = Version("1.2.3")
|
|
421
|
+
self.assertEqual(str(v), "1.2.3")
|
|
422
|
+
self.assertIsNone(v.public.qualification.dev)
|
|
423
|
+
|
|
424
|
+
def test_dev_as_none(self: Self) -> None:
|
|
425
|
+
v: Version = Version("1.2.3")
|
|
426
|
+
v.public.qualification.dev = None
|
|
427
|
+
self.assertEqual(str(v), "1.2.3")
|
|
428
|
+
self.assertIsNone(v.public.qualification.dev)
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
class TestVersionSpecifiersNoGo(unittest.TestCase):
|
|
432
|
+
|
|
433
|
+
def test_version_with_invalid_specifiers(self: Self) -> None:
|
|
434
|
+
# Test version with invalid specifiers that should raise an error
|
|
435
|
+
with self.assertRaises(VersionError):
|
|
436
|
+
Version("1.2.3--4")
|
|
437
|
+
|
|
438
|
+
with self.assertRaises(VersionError):
|
|
439
|
+
Version("1.2.3a1--4")
|
|
440
|
+
|
|
441
|
+
|
|
399
442
|
if __name__ == "__main__":
|
|
400
443
|
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|