![]() |
Terarea
2
The automation project
|
Functions | |
str | get_cache_busting () |
Any | _get_env_node (Dict[str, Any] env, str key, str default) |
str | _get_environement_variable (dotenv environement, str variable_name) |
str | _get_toml_variable (dict toml_conf, str section, str key, default=None) |
str | _password_generator (int length=20, str encapsulation_node="password") |
bool | are_json_responses_identical (Dict[str, Any] json_response1, Dict[str, Any] json_response2, str test_name="are_json_responses_identical") |
Variables | |
bool | DEBUG = False |
debug | |
name | |
int | DB_PORT = 3307 |
str | DB_HOST = "127.0.0.1" |
str | DB_USER = "root" |
str | DB_PASSWORD = "" |
str | DB_DATABASE = "terarea" |
str | SERVER_HOST = "0.0.0.0" |
str | QUERY_HOST = "http://127.0.0.1" |
int | PORT = 6000 |
int | QUERY_DELAY = 2 |
int | SUCCESS = 0 |
int | ERROR = 1 |
str | APP_NAME = "Area - Testing" |
SAFE_STRING = ascii_letters+digits | |
SAFE_STRING_LENGTH = len(SAFE_STRING) | |
str | CACHE_BUSTER = get_cache_busting() |
str | CACHE_BUSTER_ADMIN = f"admin_{get_cache_busting()}_admin" |
str | TEST_ENV = ".env" |
ENV = dict(dotenv.dotenv_values()) | |
Any | MINIO_HOST = _get_env_node(ENV, "MINIO_HOST", "minio") |
MINIO_PORT = int(_get_env_node(ENV, "MINIO_PORT", 9000)) | |
Any | MINIO_ROOT_USER = _get_env_node(ENV, "MINIO_ROOT_USER", "root") |
str | MINIO_ROOT_PASSWORD |
TOML_CONF = toml.load("config.toml") | |
str | PATH_GET_HOME = "/" |
str | PATH_GET_API_HOME = "/api/v1/" |
str | PATH_PUT_REGISTER = "/api/v1/register" |
str | PATH_POST_LOGIN = "/api/v1/login" |
str | PATH_PATCH_USER = "/api/v1/user" |
str | PATH_PUT_USER = "/api/v1/user" |
str | PATH_DELETE_USER = "/api/v1/user" |
str | PATH_GET_USER = "/api/v1/user" |
str | PATH_GET_USER_ID = "/api/v1/user_id" |
str | PATH_POST_LOGOUT = "/api/v1/logout" |
str | LAMBDA_USER_TOKEN_KEY = "lambda_user" |
str | ADMIN_USER_TOKEN_KEY = "admin_user" |
str | TOKEN_AUTH_ID_STR = "Authorization" |
str | PRETTY_TOKEN_KEY = "token_header" |
str | RAW_TOKEN_KEY = "token_key" |
str | USER_DATA_EMAIL = f"some_email_{CACHE_BUSTER}@company.example" |
str | USER_DATA_USERNAME = USER_DATA_EMAIL.split("@")[0] |
str | USER_DATA_PASSWORD |
str | USER_DATA_METHOD = "local" |
str | USER_DATA_FAVICON = "NULL" |
str | USER_DATA_ADMIN = "0" |
str | USER_DATA_TOKEN = f"some_token_{CACHE_BUSTER}_some_token" |
int | USER_DATA_TOKEN_LIFESPAN = 3600 |
str | USER_DATA_EMAIL_REBIND = f"some_email_{CACHE_BUSTER}_rebind@company.example" |
str | USER_DATA_USERNAME_REBIND = USER_DATA_EMAIL_REBIND.split("@")[0] |
str | USER_DATA_PASSWORD_REBIND |
str | USER_DATA_EMAIL_PATCH = f"some_email_{CACHE_BUSTER}_patch@company.com" |
str | USER_DATA_USERNAME_PATCH = USER_DATA_EMAIL_PATCH.split("@")[0] |
str | USER_DATA_PASSWORD_PATCH |
str | ADMIN_DATA_EMAIL = f"some_email_{CACHE_BUSTER_ADMIN}@company.example" |
str | ADMIN_DATA_USERNAME = ADMIN_DATA_EMAIL.split("@")[0] |
str | ADMIN_DATA_PASSWORD |
str | ADMIN_DATA_METHOD = "local" |
str | ADMIN_DATA_FAVICON = "NULL" |
str | ADMIN_DATA_ADMIN = "1" |
str | ADMIN_DATA_TOKEN = f"some_token_{CACHE_BUSTER_ADMIN}_some_token" |
int | ADMIN_DATA_TOKEN_LIFESPAN = 3600 |
str | ADMIN_DATA_EMAIL_REBIND = f"some_email_{CACHE_BUSTER_ADMIN}_" |
str | ADMIN_DATA_USERNAME_REBIND = ADMIN_DATA_EMAIL_REBIND.split("@")[0] |
str | ADMIN_DATA_PASSWORD_REBIND |
str | ADMIN_DATA_EMAIL_PATCH = f"some_email_{CACHE_BUSTER_ADMIN}_patch@company.com" |
str | ADMIN_DATA_USERNAME_PATCH = ADMIN_DATA_EMAIL_PATCH.split("@")[0] |
str | ADMIN_DATA_PASSWORD_PATCH |
str | UNODE_EMAIL_KEY = "email" |
str | UNODE_PASSWORD_KEY = "password" |
str | UNODE_USERNAME_KEY = "username" |
str | UNODE_METHOD_KEY = "method" |
str | UNODE_FAVICON_KEY = "favicon" |
str | UNODE_ADMIN_KEY = "admin" |
str | USER_NORMAL_MODE = "normal" |
str | USER_PUT_MODE = "put" |
str | USER_PATCH_MODE = "patch" |
str | RUNTIME_NODE_CRITICAL_KEY = "critical" |
dict | RESPONSE_GET_HOME_RESPONSE_NOT_LOGGED_IN |
dict | RESPONSE_GET_HOME_API_RESPONSE_NOT_LOGGED_IN |
dict | RESPONSE_POST_LOGIN |
dict | RESPONSE_POST_REGISTER |
dict | RESPONSE_PUT_USER |
dict | RESPONSE_PATCH_USER |
dict | RESPONSE_GET_USER |
dict | RESPONSE_GET_USER_ID |
dict | RESPONSE_POST_LOGOUT |
dict | RESPONSE_DELETE_USER |
_summary_ This is the file in charge of storing the variable constants Raises: ValueError: _description_ KeyError: _description_ KeyError: _description_ RuntimeError: _description_ Returns: _type_: _description_
|
protected |
_summary_ Load the variable from the environement. Otherwise, use the default value provided. Args: key (_type_): _description_ default (_type_): _description_ Returns: Any: _description_
Definition at line 83 of file constants.py.
|
protected |
_summary_ Get the content of an environement variable. Args: variable_name (str): _description_ Returns: str: _description_: the value of that variable, otherwise an exception is raised.
Definition at line 100 of file constants.py.
|
protected |
Get the value of a configuration variable from the TOML file. Args: toml_conf (dict): The loaded TOML configuration as a dictionary. section (str): The section of the TOML file to search in. key (str): The key within the section to fetch. default: The default value to return if the key is not found. Defaults to None. Returns: str: The value of the configuration variable, or the default value if the key is not found. Raises: KeyError: If the section is not found in the TOML configuration.
Definition at line 118 of file constants.py.
|
protected |
_summary_ This is a function in charge of generating a password for on the fly accounts. Args: length (int, optional): _description_. Defaults to 20. Returns: str: _description_
Definition at line 159 of file constants.py.
bool constants.are_json_responses_identical | ( | Dict[str, Any] | json_response1, |
Dict[str, Any] | json_response2, | ||
str | test_name = "are_json_responses_identical" ) |
_summary_ This function is in charge of comparing two json responses to see if they are identical. Args: json_response1 (Dict[str,Any]): _description_: The first json response you wish to compare json_response2 (Dict[str,Any]): _description_: The json response that the first response will be compared against Returns: bool: _description_: Returns True if they are identical, False otherwise.
Definition at line 188 of file constants.py.
str constants.get_cache_busting | ( | ) |
_summary_ This function is in charge of generating a cache busting string. This is done in order to avoid creating already existing accounts Returns: str: _description_
Definition at line 56 of file constants.py.
str constants.ADMIN_DATA_ADMIN = "1" |
Definition at line 319 of file constants.py.
str constants.ADMIN_DATA_EMAIL = f"some_email_{CACHE_BUSTER_ADMIN}@company.example" |
Definition at line 312 of file constants.py.
str constants.ADMIN_DATA_EMAIL_PATCH = f"some_email_{CACHE_BUSTER_ADMIN}_patch@company.com" |
Definition at line 332 of file constants.py.
str constants.ADMIN_DATA_EMAIL_REBIND = f"some_email_{CACHE_BUSTER_ADMIN}_" |
Definition at line 324 of file constants.py.
str constants.ADMIN_DATA_FAVICON = "NULL" |
Definition at line 318 of file constants.py.
str constants.ADMIN_DATA_METHOD = "local" |
Definition at line 317 of file constants.py.
str constants.ADMIN_DATA_PASSWORD |
Definition at line 314 of file constants.py.
str constants.ADMIN_DATA_PASSWORD_PATCH |
Definition at line 334 of file constants.py.
str constants.ADMIN_DATA_PASSWORD_REBIND |
Definition at line 327 of file constants.py.
str constants.ADMIN_DATA_TOKEN = f"some_token_{CACHE_BUSTER_ADMIN}_some_token" |
Definition at line 320 of file constants.py.
int constants.ADMIN_DATA_TOKEN_LIFESPAN = 3600 |
Definition at line 321 of file constants.py.
str constants.ADMIN_DATA_USERNAME = ADMIN_DATA_EMAIL.split("@")[0] |
Definition at line 313 of file constants.py.
str constants.ADMIN_DATA_USERNAME_PATCH = ADMIN_DATA_EMAIL_PATCH.split("@")[0] |
Definition at line 333 of file constants.py.
str constants.ADMIN_DATA_USERNAME_REBIND = ADMIN_DATA_EMAIL_REBIND.split("@")[0] |
Definition at line 326 of file constants.py.
str constants.ADMIN_USER_TOKEN_KEY = "admin_user" |
Definition at line 280 of file constants.py.
str constants.APP_NAME = "Area - Testing" |
Definition at line 48 of file constants.py.
str constants.CACHE_BUSTER = get_cache_busting() |
Definition at line 222 of file constants.py.
str constants.CACHE_BUSTER_ADMIN = f"admin_{get_cache_busting()}_admin" |
Definition at line 223 of file constants.py.
Any constants.DB_DATABASE = "terarea" |
Definition at line 36 of file constants.py.
Any constants.DB_HOST = "127.0.0.1" |
Definition at line 33 of file constants.py.
str constants.DB_PASSWORD = "" |
Definition at line 35 of file constants.py.
constants.DB_PORT = 3307 |
Definition at line 32 of file constants.py.
Any constants.DB_USER = "root" |
Definition at line 34 of file constants.py.
bool constants.DEBUG = False |
Definition at line 26 of file constants.py.
constants.debug |
Definition at line 28 of file constants.py.
constants.ENV = dict(dotenv.dotenv_values()) |
Definition at line 228 of file constants.py.
constants.ERROR = 1 |
Definition at line 46 of file constants.py.
str constants.LAMBDA_USER_TOKEN_KEY = "lambda_user" |
Definition at line 279 of file constants.py.
Any constants.MINIO_HOST = _get_env_node(ENV, "MINIO_HOST", "minio") |
Definition at line 235 of file constants.py.
constants.MINIO_PORT = int(_get_env_node(ENV, "MINIO_PORT", 9000)) |
Definition at line 236 of file constants.py.
str constants.MINIO_ROOT_PASSWORD |
Definition at line 238 of file constants.py.
Any constants.MINIO_ROOT_USER = _get_env_node(ENV, "MINIO_ROOT_USER", "root") |
Definition at line 237 of file constants.py.
constants.name |
Definition at line 30 of file constants.py.
str constants.PATH_DELETE_USER = "/api/v1/user" |
Definition at line 273 of file constants.py.
str constants.PATH_GET_API_HOME = "/api/v1/" |
Definition at line 268 of file constants.py.
str constants.PATH_GET_HOME = "/" |
Definition at line 267 of file constants.py.
str constants.PATH_GET_USER = "/api/v1/user" |
Definition at line 274 of file constants.py.
str constants.PATH_GET_USER_ID = "/api/v1/user_id" |
Definition at line 275 of file constants.py.
str constants.PATH_PATCH_USER = "/api/v1/user" |
Definition at line 271 of file constants.py.
str constants.PATH_POST_LOGIN = "/api/v1/login" |
Definition at line 270 of file constants.py.
str constants.PATH_POST_LOGOUT = "/api/v1/logout" |
Definition at line 276 of file constants.py.
str constants.PATH_PUT_REGISTER = "/api/v1/register" |
Definition at line 269 of file constants.py.
str constants.PATH_PUT_USER = "/api/v1/user" |
Definition at line 272 of file constants.py.
constants.PORT = 6000 |
Definition at line 40 of file constants.py.
str constants.PRETTY_TOKEN_KEY = "token_header" |
Definition at line 282 of file constants.py.
int constants.QUERY_DELAY = 2 |
Definition at line 43 of file constants.py.
constants.QUERY_HOST = "http://127.0.0.1" |
Definition at line 39 of file constants.py.
str constants.RAW_TOKEN_KEY = "token_key" |
Definition at line 283 of file constants.py.
dict constants.RESPONSE_DELETE_USER |
Definition at line 410 of file constants.py.
dict constants.RESPONSE_GET_HOME_API_RESPONSE_NOT_LOGGED_IN |
Definition at line 361 of file constants.py.
dict constants.RESPONSE_GET_HOME_RESPONSE_NOT_LOGGED_IN |
Definition at line 355 of file constants.py.
dict constants.RESPONSE_GET_USER |
Definition at line 392 of file constants.py.
dict constants.RESPONSE_GET_USER_ID |
Definition at line 398 of file constants.py.
dict constants.RESPONSE_PATCH_USER |
Definition at line 386 of file constants.py.
dict constants.RESPONSE_POST_LOGIN |
Definition at line 367 of file constants.py.
dict constants.RESPONSE_POST_LOGOUT |
Definition at line 404 of file constants.py.
dict constants.RESPONSE_POST_REGISTER |
Definition at line 374 of file constants.py.
dict constants.RESPONSE_PUT_USER |
Definition at line 380 of file constants.py.
str constants.RUNTIME_NODE_CRITICAL_KEY = "critical" |
Definition at line 352 of file constants.py.
constants.SAFE_STRING = ascii_letters+digits |
Definition at line 52 of file constants.py.
constants.SAFE_STRING_LENGTH = len(SAFE_STRING) |
Definition at line 53 of file constants.py.
constants.SERVER_HOST = "0.0.0.0" |
Definition at line 38 of file constants.py.
constants.SUCCESS = 0 |
Definition at line 45 of file constants.py.
str constants.TEST_ENV = ".env" |
Definition at line 225 of file constants.py.
str constants.TOKEN_AUTH_ID_STR = "Authorization" |
Definition at line 281 of file constants.py.
constants.TOML_CONF = toml.load("config.toml") |
Definition at line 248 of file constants.py.
str constants.UNODE_ADMIN_KEY = "admin" |
Definition at line 344 of file constants.py.
str constants.UNODE_EMAIL_KEY = "email" |
Definition at line 339 of file constants.py.
str constants.UNODE_FAVICON_KEY = "favicon" |
Definition at line 343 of file constants.py.
str constants.UNODE_METHOD_KEY = "method" |
Definition at line 342 of file constants.py.
str constants.UNODE_PASSWORD_KEY = "password" |
Definition at line 340 of file constants.py.
str constants.UNODE_USERNAME_KEY = "username" |
Definition at line 341 of file constants.py.
str constants.USER_DATA_ADMIN = "0" |
Definition at line 293 of file constants.py.
str constants.USER_DATA_EMAIL = f"some_email_{CACHE_BUSTER}@company.example" |
Definition at line 286 of file constants.py.
str constants.USER_DATA_EMAIL_PATCH = f"some_email_{CACHE_BUSTER}_patch@company.com" |
Definition at line 305 of file constants.py.
str constants.USER_DATA_EMAIL_REBIND = f"some_email_{CACHE_BUSTER}_rebind@company.example" |
Definition at line 298 of file constants.py.
str constants.USER_DATA_FAVICON = "NULL" |
Definition at line 292 of file constants.py.
str constants.USER_DATA_METHOD = "local" |
Definition at line 291 of file constants.py.
str constants.USER_DATA_PASSWORD |
Definition at line 288 of file constants.py.
str constants.USER_DATA_PASSWORD_PATCH |
Definition at line 307 of file constants.py.
str constants.USER_DATA_PASSWORD_REBIND |
Definition at line 300 of file constants.py.
str constants.USER_DATA_TOKEN = f"some_token_{CACHE_BUSTER}_some_token" |
Definition at line 294 of file constants.py.
int constants.USER_DATA_TOKEN_LIFESPAN = 3600 |
Definition at line 295 of file constants.py.
str constants.USER_DATA_USERNAME = USER_DATA_EMAIL.split("@")[0] |
Definition at line 287 of file constants.py.
str constants.USER_DATA_USERNAME_PATCH = USER_DATA_EMAIL_PATCH.split("@")[0] |
Definition at line 306 of file constants.py.
str constants.USER_DATA_USERNAME_REBIND = USER_DATA_EMAIL_REBIND.split("@")[0] |
Definition at line 299 of file constants.py.
str constants.USER_NORMAL_MODE = "normal" |
Definition at line 347 of file constants.py.
str constants.USER_PATCH_MODE = "patch" |
Definition at line 349 of file constants.py.
str constants.USER_PUT_MODE = "put" |
Definition at line 348 of file constants.py.