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:
parent
527f5a9512
commit
c399ff81a1
|
@ -25,6 +25,8 @@ def test_guess_main(args, tmpdir):
|
||||||
args.aports = tmpdir
|
args.aports = tmpdir
|
||||||
for aport in ["temp/qemu", "main/some-pkg"]:
|
for aport in ["temp/qemu", "main/some-pkg"]:
|
||||||
os.makedirs(tmpdir + "/" + aport)
|
os.makedirs(tmpdir + "/" + aport)
|
||||||
|
with open(tmpdir + "/" + aport + "/APKBUILD", 'w'):
|
||||||
|
pass
|
||||||
|
|
||||||
func = pmb.helpers.pmaports.guess_main
|
func = pmb.helpers.pmaports.guess_main
|
||||||
assert func(args, "qemu-x86_64") == tmpdir + "/temp/qemu"
|
assert func(args, "qemu-x86_64") == tmpdir + "/temp/qemu"
|
||||||
|
@ -38,6 +40,8 @@ def test_guess_main_dev(args, tmpdir):
|
||||||
tmpdir = str(tmpdir)
|
tmpdir = str(tmpdir)
|
||||||
args.aports = tmpdir
|
args.aports = tmpdir
|
||||||
os.makedirs(tmpdir + "/temp/plasma")
|
os.makedirs(tmpdir + "/temp/plasma")
|
||||||
|
with open(tmpdir + "/temp/plasma/APKBUILD", 'w'):
|
||||||
|
pass
|
||||||
|
|
||||||
func = pmb.helpers.pmaports.guess_main_dev
|
func = pmb.helpers.pmaports.guess_main_dev
|
||||||
assert func(args, "plasma-framework-dev") is None
|
assert func(args, "plasma-framework-dev") is None
|
||||||
|
|
Loading…
Reference in New Issue