forked from Mirror/pmbootstrap
When installing pmboostrap, all tests are installed alongside it. There doesn't seem to be any way to selectively exclude some files inside python modules, so move all test into a separate module instead. This is the typical convention in python projects. See: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/79862 Fixes: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2541
28 lines
960 B
Python
28 lines
960 B
Python
# Copyright 2024 Caleb Connolly
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import pmb.config
|
|
from pmb.core.config import SystemdConfig
|
|
|
|
"""Test the config file serialization and deserialization."""
|
|
|
|
|
|
def test_load(config_file):
|
|
config = pmb.config.load(config_file)
|
|
assert config.build_default_device_arch
|
|
assert config.ccache_size == "5G"
|
|
assert config.device == "qemu-amd64"
|
|
assert config.extra_packages == "neofetch,neovim,reboot-mode"
|
|
assert config.hostname == "qemu-amd64"
|
|
assert not config.is_default_channel
|
|
assert config.jobs == 8
|
|
assert config.kernel == "edge"
|
|
assert config.locale == "C.UTF-8"
|
|
assert config.ssh_keys
|
|
assert config.sudo_timer
|
|
assert config.systemd == SystemdConfig.ALWAYS
|
|
assert config.timezone == "Europe/Berlin"
|
|
assert config.ui == "gnome"
|
|
assert config.providers == {}
|
|
assert config.mirrors["pmaports"] is not None
|
|
assert ".pytest_tmp" in config.work.parts
|