mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 05:04:38 +03:00
Introduce metadata package (#305)
* Introduce metadata module that has Versions and ListCommand class Signed-off-by: Hiroshi Miura <miurahr@linux.com> * Introduce custom Version class A Version class override semantic_version.Version class that accept qt versions and tools versions Signed-off-by: Hiroshi Miura <miurahr@linux.com> * PEP8/Black Signed-off-by: Hiroshi Miura <miurahr@linux.com> * Improve test assertion Signed-off-by: Hiroshi Miura <miurahr@linux.com> * Move ArchiveId class to metadata module And Improve imports Signed-off-by: Hiroshi Miura <miurahr@linux.com> * Refactoring Version class Signed-off-by: Hiroshi Miura <miurahr@linux.com> * Refactoring Table class Signed-off-by: Hiroshi Miura <miurahr@linux.com> * Refactoring Table class(wip) Signed-off-by: Hiroshi Miura <miurahr@linux.com> * Fix output format of `list tools` command Signed-off-by: Hiroshi Miura <miurahr@linux.com> * list: Improve print output avoid str.join() Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
@@ -4,9 +4,9 @@ import os
|
||||
import pytest
|
||||
import requests
|
||||
from requests.models import Response
|
||||
from semantic_version import Version
|
||||
|
||||
from aqt import helper
|
||||
from aqt.metadata import Version
|
||||
|
||||
|
||||
def test_helper_altlink(monkeypatch):
|
||||
@@ -102,11 +102,17 @@ def test_helper_downloadBinary_sha256(tmp_path, monkeypatch):
|
||||
@pytest.mark.parametrize(
|
||||
"version, expect",
|
||||
[
|
||||
("1.33.1", Version("1.33.1")),
|
||||
("1.33.1-202102101246", Version("1.33.1-202102101246")),
|
||||
("1.33-202102101246", Version("1.33.0-202102101246")),
|
||||
("2020-05-19-1", Version("2020.0.0-05-19-1")),
|
||||
("1.33.1", Version(major=1, minor=33, patch=1)),
|
||||
(
|
||||
"1.33.1-202102101246",
|
||||
Version(major=1, minor=33, patch=1, build=("202102101246",)),
|
||||
),
|
||||
(
|
||||
"1.33-202102101246",
|
||||
Version(major=1, minor=33, patch=0, build=("202102101246",)),
|
||||
),
|
||||
("2020-05-19-1", Version(major=2020, minor=0, patch=0, build=("05-19-1",))),
|
||||
],
|
||||
)
|
||||
def test_helper_to_version_permissive(version, expect):
|
||||
assert helper.to_version_permissive(version) == expect
|
||||
assert Version.permissive(version) == expect
|
||||
|
||||
Reference in New Issue
Block a user