tests: update following names change

This commit is contained in:
Goffi 2021-04-16 18:32:34 +02:00
commit adb09a719f

View file

@ -26,7 +26,7 @@ from aiosmtpd.controller import Controller
from aiosmtpd.handlers import Message
from email.message import EmailMessage
import sh
from sh import jp
from sh import li
import pytest
@ -35,7 +35,7 @@ class FakeFile:
BUF_SIZE = 65535
def __init__(self):
self.tmp_dir_obj = tempfile.TemporaryDirectory(prefix="sat_e2e_test_files_")
self.tmp_dir_obj = tempfile.TemporaryDirectory(prefix="libervia_e2e_test_files_")
self.tmp_dir_path = Path(self.tmp_dir_obj.name)
self.source_files = self.tmp_dir_path / "source"
self.source_files.mkdir()
@ -157,7 +157,7 @@ def test_profiles():
profile = f"account{account_idx}{profile_suff}"
profiles.append(profile)
try:
jp.account.create(
li.account.create(
f"account{account_idx}@server{server_idx}.test",
"test",
profile=profile,
@ -167,14 +167,14 @@ def test_profiles():
# this is the conlict exit code, this can happen when tests are run
# inside a container when --keep-profiles is used with run_e2e.py.
pass
jp.profile.modify(profile="account1", default=True, connect=True)
jp.profile.connect(profile="account1_s2", connect=True)
li.profile.modify(profile="account1", default=True, connect=True)
li.profile.connect(profile="account1_s2", connect=True)
yield tuple(profiles)
# This environment may be used during tests development
if os.getenv("SAT_TEST_E2E_KEEP_PROFILES") == None:
if os.getenv("LIBERVIA_TEST_E2E_KEEP_PROFILES") == None:
for profile in profiles:
jp.account.delete(profile=profile, connect=True, force=True)
jp.profile.delete(profile, force=True)
li.account.delete(profile=profile, connect=True, force=True)
li.profile.delete(profile, force=True)
@pytest.fixture(scope="class")
@ -183,25 +183,25 @@ def pubsub_nodes(test_profiles):
Both nodes will be created with "account1" profile, named "test" and have an "open"
access model.
One node will account1's PEP, the other one on pubsub.server1.test.
One node will be on account1's PEP, the other one on pubsub.server1.test.
"""
jp.pubsub.node.create(
li.pubsub.node.create(
"-f", "access_model", "open",
node="test",
profile="account1", connect=True
)
jp.pubsub.node.create(
li.pubsub.node.create(
"-f", "access_model", "open",
service="pubsub.server1.test", node="test",
profile="account1"
)
yield
jp.pubsub.node.delete(
li.pubsub.node.delete(
node="test",
profile="account1", connect=True,
force=True
)
jp.pubsub.node.delete(
li.pubsub.node.delete(
service="pubsub.server1.test", node="test",
profile="account1",
force=True