def test_add_user(): create_database_user("any path") db = get_database_user() new_user = FullUser(username="******",password="******") db.post(new_user) user = db.get_user(name='test',password='******') assert user.username == new_user.username
def test_create_db(): create_database_user("any path") db = get_database_user() assert issubclass(type(db),DBUser)
def test_get_user(): create_database_user("any path") db = get_database_user() user = db.get_user(name="test_user",password="******") assert user is None
def test_add_user_error(): with pytest.raises(ValueError): create_database_user("any path") db = get_database_user() user = db.post(FullUser())
async def startup_event(): path_user_db = config.get('DEFAULT','Path_userdatabase') create_database_user(path_user_db) path = config.get("DEFAULT",'Path_db') create_database(path)