mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
manifestv2: moar test fixes
This commit is contained in:
parent
f4cb20f081
commit
4faeabefa2
3 changed files with 12 additions and 10 deletions
|
@ -926,7 +926,7 @@ ynh_compare_current_package_version() {
|
||||||
_ynh_apply_default_permissions() {
|
_ynh_apply_default_permissions() {
|
||||||
local target=$1
|
local target=$1
|
||||||
|
|
||||||
local ynh_requirement=$(ynh_read_manifest --key=".requirements.yunohost")
|
local ynh_requirement=$(ynh_read_manifest --manifest_key="requirements.yunohost")
|
||||||
|
|
||||||
if dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} ge 2 || [ -z "$ynh_requirement" ] || [ "$ynh_requirement" == "null" ] || dpkg --compare-versions $ynh_requirement ge 4.2; then
|
if dpkg --compare-versions ${YNH_APP_PACKAGING_FORMAT:-0} ge 2 || [ -z "$ynh_requirement" ] || [ "$ynh_requirement" == "null" ] || dpkg --compare-versions $ynh_requirement ge 4.2; then
|
||||||
chmod o-rwx $target
|
chmod o-rwx $target
|
||||||
|
|
|
@ -219,8 +219,8 @@ def test_legacy_app_manifest_preinstall():
|
||||||
assert "description" in m
|
assert "description" in m
|
||||||
assert "integration" in m
|
assert "integration" in m
|
||||||
assert "install" in m
|
assert "install" in m
|
||||||
assert m.get("doc") == {}
|
assert m["doc"] == {}
|
||||||
assert m.get["notifications"] == {"pre_install": {}, "pre_upgrade": {}, "post_install": {}, "post_upgrade": {}}
|
assert m["notifications"] == {"pre_install": {}, "pre_upgrade": {}, "post_install": {}, "post_upgrade": {}}
|
||||||
|
|
||||||
|
|
||||||
def test_manifestv2_app_manifest_preinstall():
|
def test_manifestv2_app_manifest_preinstall():
|
||||||
|
@ -271,9 +271,9 @@ def test_manifestv2_app_info_postinstall():
|
||||||
assert "The app install dir is /var/www/manifestv2_app" in m["doc"]["ADMIN"]["en"]
|
assert "The app install dir is /var/www/manifestv2_app" in m["doc"]["ADMIN"]["en"]
|
||||||
assert "Le dossier d'install de l'app est /var/www/manifestv2_app" in m["doc"]["ADMIN"]["fr"]
|
assert "Le dossier d'install de l'app est /var/www/manifestv2_app" in m["doc"]["ADMIN"]["fr"]
|
||||||
assert "notifications" in m
|
assert "notifications" in m
|
||||||
assert "The app install dir is /var/www/manifestv2_app" in m["notifications"]["post_install"]["en"]
|
assert "The app install dir is /var/www/manifestv2_app" in m["notifications"]["post_install"]["main"]["en"]
|
||||||
assert "The app id is manifestv2_app" in m["notifications"]["post_install"]["en"]
|
assert "The app id is manifestv2_app" in m["notifications"]["post_install"]["main"]["en"]
|
||||||
assert f"The app url is {main_domain}/manifestv2" in m["notifications"]["post_install"]["en"]
|
assert f"The app url is {main_domain}/manifestv2" in m["notifications"]["post_install"]["main"]["en"]
|
||||||
|
|
||||||
|
|
||||||
def test_manifestv2_app_info_preupgrade(monkeypatch):
|
def test_manifestv2_app_info_preupgrade(monkeypatch):
|
||||||
|
@ -290,6 +290,7 @@ def test_manifestv2_app_info_preupgrade(monkeypatch):
|
||||||
"lastUpdate": 999999999,
|
"lastUpdate": 999999999,
|
||||||
"maintained": True,
|
"maintained": True,
|
||||||
"manifest": manifest,
|
"manifest": manifest,
|
||||||
|
"state": "working",
|
||||||
}
|
}
|
||||||
res["apps"]["manifestv2_app"]["manifest"]["version"] = "99999~ynh1"
|
res["apps"]["manifestv2_app"]["manifest"]["version"] = "99999~ynh1"
|
||||||
|
|
||||||
|
@ -306,7 +307,7 @@ def test_manifestv2_app_info_preupgrade(monkeypatch):
|
||||||
# does provide the notifications, which means the list builder script
|
# does provide the notifications, which means the list builder script
|
||||||
# should parse the files in the original app repo, possibly with proper i18n etc
|
# should parse the files in the original app repo, possibly with proper i18n etc
|
||||||
assert "This is a dummy disclaimer to display prior to any upgrade" \
|
assert "This is a dummy disclaimer to display prior to any upgrade" \
|
||||||
in i["from_catalog"]["manifest"]["notifications"]["pre_upgrade"]
|
in i["from_catalog"]["manifest"]["notifications"]["pre_upgrade"]["main"]["en"]
|
||||||
|
|
||||||
def test_app_from_catalog():
|
def test_app_from_catalog():
|
||||||
main_domain = _get_maindomain()
|
main_domain = _get_maindomain()
|
||||||
|
|
|
@ -615,6 +615,7 @@ class PortsResource(AppResource):
|
||||||
# Automigrate from legacy setting foobar_port (instead of port_foobar)
|
# Automigrate from legacy setting foobar_port (instead of port_foobar)
|
||||||
legacy_setting_name = "{name}_port"
|
legacy_setting_name = "{name}_port"
|
||||||
port_value = self.get_setting(legacy_setting_name)
|
port_value = self.get_setting(legacy_setting_name)
|
||||||
|
if port_value:
|
||||||
self.set_setting(setting_name, port_value)
|
self.set_setting(setting_name, port_value)
|
||||||
self.delete_setting(legacy_setting_name)
|
self.delete_setting(legacy_setting_name)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue