Implement check for updates feature (#558)

* Implement check for updates

* Fix tests

* Bump version
This commit is contained in:
Nathan Thomas 2024-01-13 22:49:23 -08:00 committed by GitHub
parent 8bc87a4b74
commit fa65929c97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 52 additions and 20 deletions

Binary file not shown.

View file

@ -127,7 +127,7 @@ def test_sample_config_data_fields(sample_config_data):
bit_depth=24,
lossy_bitrate=320,
),
misc=MiscConfig(version="2.0"),
misc=MiscConfig(version="2.0", check_for_updates=True),
_modified=False,
)
assert sample_config_data.downloads == test_config.downloads

View file

@ -185,4 +185,5 @@ max_search_results = 100
[misc]
# Metadata to identify this config file. Do not change.
version = "2.0"
version = "2.0.3"
check_for_updates = true

View file

@ -24,19 +24,9 @@ def config_version() -> str | None:
return m.group(1)
@pytest.fixture
def click_version() -> str | None:
r = re.compile(r'\@click\.version_option\(version="([\d\.]+)"\)')
with open("streamrip/rip/cli.py") as f:
m = r.search(f.read())
assert m is not None
return m.group(1)
def test_config_versions_match(config_version):
assert config_version == CURRENT_CONFIG_VERSION
def test_streamrip_versions_match(pyproject_version, click_version):
assert pyproject_version == click_version
assert click_version == init_version
def test_streamrip_versions_match(pyproject_version):
assert pyproject_version == init_version