mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 05:46:29 +03:00
improve error messages during live creation of accounts
This commit is contained in:
@@ -155,19 +155,21 @@ class TestProcess:
|
|||||||
|
|
||||||
yield from iter(configlist)
|
yield from iter(configlist)
|
||||||
else:
|
else:
|
||||||
for index in range(10):
|
MAX_LIVE_CREATED_ACCOUNTS = 10
|
||||||
|
for index in range(MAX_LIVE_CREATED_ACCOUNTS):
|
||||||
try:
|
try:
|
||||||
yield configlist[index]
|
yield configlist[index]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
res = requests.post(liveconfig_opt)
|
res = requests.post(liveconfig_opt)
|
||||||
if res.status_code != 200:
|
if res.status_code != 200:
|
||||||
pytest.fail("creat newtmpuser failed {}: '{}'".format(
|
pytest.fail("newtmpuser count={} code={}: '{}'".format(
|
||||||
res.status_code, res.text))
|
index, res.status_code, res.text))
|
||||||
d = res.json()
|
d = res.json()
|
||||||
config = dict(addr=d["email"], mail_pw=d["password"])
|
config = dict(addr=d["email"], mail_pw=d["password"])
|
||||||
|
print("newtmpuser {}: addr={}".format(index, config["addr"]))
|
||||||
configlist.append(config)
|
configlist.append(config)
|
||||||
yield config
|
yield config
|
||||||
pytest.fail("more than 10 live accounts requested. Is a test running wild?")
|
pytest.fail("more than {} live accounts requested.".format(MAX_LIVE_CREATED_ACCOUNTS))
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
Reference in New Issue
Block a user