[extensions-web/wip/shell-point-version] extensions: ignore Shell 40+ version parts after minor
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web/wip/shell-point-version] extensions: ignore Shell 40+ version parts after minor
- Date: Sat, 9 Jul 2022 12:56:20 +0000 (UTC)
commit 13a625956a0f38195d109295849458fd7eed143e
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Sat Jul 9 16:56:15 2022 +0400
extensions: ignore Shell 40+ version parts after minor
Fixes: https://gitlab.gnome.org/Infrastructure/extensions-web/-/issues/194
sweettooth/extensions/models.py | 4 +---
sweettooth/extensions/tests.py | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/sweettooth/extensions/models.py b/sweettooth/extensions/models.py
index 8a53802..aaca32a 100644
--- a/sweettooth/extensions/models.py
+++ b/sweettooth/extensions/models.py
@@ -246,9 +246,7 @@ def parse_version_string(version_string):
point = -1
if version_parts > 2:
- if major >= 40:
- raise InvalidShellVersion()
- else:
+ if major < 40:
# 3.0.1, 3.1.4
try:
point = int(version[2])
diff --git a/sweettooth/extensions/tests.py b/sweettooth/extensions/tests.py
index 1ccc3cc..99c18da 100644
--- a/sweettooth/extensions/tests.py
+++ b/sweettooth/extensions/tests.py
@@ -437,6 +437,24 @@ class ShellVersionTest(TestCase):
self.assertEqual(version.minor, 3)
self.assertEqual(version.point, -1)
+ self.assertEqual(lookup_version("42.3.1"), None)
+ self.assertEqual(lookup_version("42.3"), None)
+ version = get_version("42.3.1")
+ self.assertEqual(lookup_version("42.3.1"), version)
+ self.assertEqual(lookup_version("42.3"), version)
+ self.assertEqual(version.major, 42)
+ self.assertEqual(version.minor, 3)
+ self.assertEqual(version.point, -1)
+
+ self.assertEqual(lookup_version("51.0.1.2"), None)
+ version = get_version("51.0.1.2")
+ self.assertEqual(lookup_version("51.0.1.2"), version)
+ self.assertEqual(lookup_version("51.0.1"), version)
+ self.assertEqual(lookup_version("51.0"), version)
+ self.assertEqual(version.major, 51)
+ self.assertEqual(version.minor, 0)
+ self.assertEqual(version.point, -1)
+
version1 = get_version("3.2.2")
self.assertEqual(lookup_version("3.2.2.1"), version1)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]