File: test_update.py

package info (click to toggle)
zabbix-cli 3.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,860 kB
  • sloc: python: 18,557; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 874 bytes parent folder | download | duplicates (2)
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
from __future__ import annotations

import pytest
from zabbix_cli.update import PyInstallerUpdater


@pytest.mark.parametrize(
    "os, arch, version, expect_info",
    [
        ("linux", "x86_64", "1.2.3", "1.2.3-linux-x86_64"),
        ("linux", "arm64", "1.2.3", "1.2.3-linux-arm64"),
        ("linux", "armv7l", "1.2.3", "1.2.3-linux-armv7l"),
        ("darwin", "x86_64", "1.2.3", "1.2.3-macos-x86_64"),
        ("darwin", "arm64", "1.2.3", "1.2.3-macos-arm64"),
        ("win32", "x86_64", "1.2.3", "1.2.3-win-x86_64.exe"),
    ],
)
def test_pyinstaller_updater_get_url(
    os: str, arch: str, version: str, expect_info: str
):
    BASE_URL = (
        "https://github.com/unioslo/zabbix-cli/releases/latest/download/zabbix-cli"
    )
    expect_url = f"{BASE_URL}-{expect_info}"

    url = PyInstallerUpdater.get_url(os, arch, version)
    assert url == expect_url