mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Only query user_list once
This commit is contained in:
parent
582350c145
commit
b457e78ace
1 changed files with 6 additions and 6 deletions
|
@ -43,9 +43,10 @@ def setup_module(module):
|
||||||
|
|
||||||
assert os.system("systemctl is-active yunohost-portal-api >/dev/null") == 0
|
assert os.system("systemctl is-active yunohost-portal-api >/dev/null") == 0
|
||||||
|
|
||||||
if "alice" not in user_list()["users"]:
|
userlist = user_list()["users"]
|
||||||
|
if "alice" not in userlist:
|
||||||
user_create("alice", maindomain, dummy_password, fullname="Alice White", admin=True)
|
user_create("alice", maindomain, dummy_password, fullname="Alice White", admin=True)
|
||||||
if "bob" not in user_list()["users"]:
|
if "bob" not in userlist:
|
||||||
user_create("bob", maindomain, dummy_password, fullname="Bob Marley")
|
user_create("bob", maindomain, dummy_password, fullname="Bob Marley")
|
||||||
|
|
||||||
app_install(
|
app_install(
|
||||||
|
@ -56,10 +57,9 @@ def setup_module(module):
|
||||||
|
|
||||||
|
|
||||||
def teardown_module(module):
|
def teardown_module(module):
|
||||||
if "alice" in user_list()["users"]:
|
userlist = user_list()["users"]
|
||||||
user_delete("alice")
|
for user in [ "alice", "bob" ]:
|
||||||
if "bob" in user_list()["users"]:
|
if user in userlist: user_delete(user)
|
||||||
user_delete("bob")
|
|
||||||
|
|
||||||
app_remove("hellopy")
|
app_remove("hellopy")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue