pmbootstrap-meow/test/test_config_init.py
Oliver Smith f21c216a26
Cosmetic: use SPDX license header (!1877)
While at it, also remove unnecessary "#!/usr/bin/env python3" in files
that only get imported, and adjust other empty/comment lines in the
beginnings of the files for consistency.

This makes files easier to read, and makes the pmbootstrap codebase more
consistent with the build.postmarketos.org codebase.
2020-02-24 03:11:10 +03:00

20 lines
514 B
Python

# Copyright 2020 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import pytest
import pmb_test # noqa
import pmb.config.init
def test_require_programs(monkeypatch):
func = pmb.config.init.require_programs
# Nothing missing
func()
# Missing program
invalid = "invalid-program-name-here-asdf"
monkeypatch.setattr(pmb.config, "required_programs", [invalid])
with pytest.raises(RuntimeError) as e:
func()
assert str(e.value).startswith("Can't find all programs")