File: test_versions.py

package info (click to toggle)
streamrip 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,560 kB
  • sloc: python: 6,308; makefile: 5
file content (32 lines) | stat: -rw-r--r-- 763 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import re

import pytest

from streamrip import __version__ as init_version
from streamrip.config import CURRENT_CONFIG_VERSION

toml_version_re = re.compile(r'version\s*\=\s*"([\d\.]+)"')


@pytest.fixture
def pyproject_version() -> str:
    with open("pyproject.toml") as f:
        m = toml_version_re.search(f.read())
    assert m is not None
    return m.group(1)


@pytest.fixture
def config_version() -> str | None:
    with open("streamrip/config.toml") as f:
        m = toml_version_re.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):
    assert pyproject_version == init_version