test/test_helpers_pmaports: create empty APKBUILDs for fake packages (!1879)

In general, we should not assume that pmbootstrap considers empty
package directories (without APKBUILD in them). With upcoming changes
this is no longer the case, so lets create an empty file for them.
This commit is contained in:
Minecrell 2020-02-26 13:48:45 +01:00 committed by Oliver Smith
parent 527f5a9512
commit c399ff81a1
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,8 @@ def test_guess_main(args, tmpdir):
args.aports = tmpdir
for aport in ["temp/qemu", "main/some-pkg"]:
os.makedirs(tmpdir + "/" + aport)
with open(tmpdir + "/" + aport + "/APKBUILD", 'w'):
pass
func = pmb.helpers.pmaports.guess_main
assert func(args, "qemu-x86_64") == tmpdir + "/temp/qemu"
@ -38,6 +40,8 @@ def test_guess_main_dev(args, tmpdir):
tmpdir = str(tmpdir)
args.aports = tmpdir
os.makedirs(tmpdir + "/temp/plasma")
with open(tmpdir + "/temp/plasma/APKBUILD", 'w'):
pass
func = pmb.helpers.pmaports.guess_main_dev
assert func(args, "plasma-framework-dev") is None