def test_account_setup_empty_values(self): account = {} with pytest.raises(AppException): loop = asyncio.new_event_loop() loop.run_until_complete( AccountProcessor.account_setup(account_setup=account, user="******"))
def test_account_setup_user_info(self): account = { "account": "Test_Account", "bot": "Test", "first_name": "Test_First", "last_name": "Test_Last", "password": SecretStr("Welcome@1"), } with pytest.raises(AppException): loop = asyncio.new_event_loop() loop.run_until_complete( AccountProcessor.account_setup(account_setup=account, user="******"))
def test_account_setup_missing_bot_name(self): account = { "account": "TestAccount", "email": "*****@*****.**", "first_name": "Test_First", "last_name": "Test_Last", "password": "******", } with pytest.raises(AppException): loop = asyncio.new_event_loop() loop.run_until_complete( AccountProcessor.account_setup(account_setup=account, user="******"))
def test_account_setup(self): account = { "account": "Test_Account", "bot": "Test", "email": "*****@*****.**", "first_name": "Test_First", "last_name": "Test_Last", "password": SecretStr("Welcome@1"), } loop = asyncio.new_event_loop() actual, mail, subject, body = loop.run_until_complete( AccountProcessor.account_setup(account_setup=account, user="******")) assert actual["role"] == "admin" assert actual["_id"] assert actual["account"] assert actual["bot"]