pmbootstrap-meow/pmb/config/test_config_serde.py
Newbyte ca5c77fa20
pmb.core.config: Fix type of jobs variable (MR 2434)
I don't think there's any case where the number of jobs would have to be
a string. It's also being assigned an integer elsewhere the code (in
ask_for_additional_options() inside of init.py), so an integer seems
like what we actually want. Also fix type errors resulting of this.
2024-10-27 00:38:16 +02:00

25 lines
883 B
Python

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