From 87f81de052daf3c41b63d0d862bc217385750e2c Mon Sep 17 00:00:00 2001 From: Minecrell Date: Sat, 11 Apr 2020 20:28:17 +0200 Subject: [PATCH] test: test_questions_ui_extras: add tests for UI extras (!1911) Ensure that it does not fail with the "none" UI (it does at the moment). --- test/test_questions.py | 11 +++++++++++ .../aports/main/postmarketos-ui-weston/APKBUILD | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/test/test_questions.py b/test/test_questions.py index 2574a84e..d600004c 100644 --- a/test/test_questions.py +++ b/test/test_questions.py @@ -223,6 +223,17 @@ def test_questions_ui(args, monkeypatch): assert pmb.config.init.ask_for_ui(args) == "weston" +def test_questions_ui_extras(args, monkeypatch): + args.aports = pmb_test.const.testdata + "/init_questions_device/aports" + assert not pmb.config.init.ask_for_ui_extras(args, "none") + + fake_answers(monkeypatch, ["n"]) + assert not pmb.config.init.ask_for_ui_extras(args, "weston") + + fake_answers(monkeypatch, ["y"]) + assert pmb.config.init.ask_for_ui_extras(args, "weston") + + def test_questions_work_path(args, monkeypatch, tmpdir): # Existing paths (triggering various errors) func = pmb.config.init.ask_for_work_path diff --git a/test/testdata/init_questions_device/aports/main/postmarketos-ui-weston/APKBUILD b/test/testdata/init_questions_device/aports/main/postmarketos-ui-weston/APKBUILD index b366af2f..fd02f16f 100644 --- a/test/testdata/init_questions_device/aports/main/postmarketos-ui-weston/APKBUILD +++ b/test/testdata/init_questions_device/aports/main/postmarketos-ui-weston/APKBUILD @@ -5,7 +5,12 @@ pkgdesc="(Wayland) Reference compositor (demo, not a phone interface)" url="https://postmarketos.org" arch="noarch" license="GPL-3.0-or-later" +subpackages="$pkgname-extras" package() { mkdir "$pkgdir" } + +extras() { + pkgdesc="Super cool extras you will definitely (not?) need" +}