[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: conftest.py
File is not writable. Editing disabled.
# -*- coding: utf-8 -*- from copy import deepcopy import pytest from cerberus import Validator @pytest.fixture def document(): return deepcopy(sample_document) @pytest.fixture def schema(): return deepcopy(sample_schema) @pytest.fixture def validator(): return Validator(sample_schema) sample_schema = { 'a_string': {'type': 'string', 'minlength': 2, 'maxlength': 10}, 'a_binary': {'type': 'binary', 'minlength': 2, 'maxlength': 10}, 'a_nullable_integer': {'type': 'integer', 'nullable': True}, 'an_integer': {'type': 'integer', 'min': 1, 'max': 100}, 'a_restricted_integer': {'type': 'integer', 'allowed': [-1, 0, 1]}, 'a_boolean': {'type': 'boolean', 'meta': 'can haz two distinct states'}, 'a_datetime': {'type': 'datetime', 'meta': {'format': '%a, %d. %b %Y'}}, 'a_float': {'type': 'float', 'min': 1, 'max': 100}, 'a_number': {'type': 'number', 'min': 1, 'max': 100}, 'a_set': {'type': 'set'}, 'one_or_more_strings': {'type': ['string', 'list'], 'schema': {'type': 'string'}}, 'a_regex_email': { 'type': 'string', 'regex': r'^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$', }, 'a_readonly_string': {'type': 'string', 'readonly': True}, 'a_restricted_string': {'type': 'string', 'allowed': ['agent', 'client', 'vendor']}, 'an_array': {'type': 'list', 'allowed': ['agent', 'client', 'vendor']}, 'an_array_from_set': { 'type': 'list', 'allowed': set(['agent', 'client', 'vendor']), }, 'a_list_of_dicts': { 'type': 'list', 'schema': { 'type': 'dict', 'schema': { 'sku': {'type': 'string'}, 'price': {'type': 'integer', 'required': True}, }, }, }, 'a_list_of_values': { 'type': 'list', 'items': [{'type': 'string'}, {'type': 'integer'}], }, 'a_list_of_integers': {'type': 'list', 'schema': {'type': 'integer'}}, 'a_dict': { 'type': 'dict', 'schema': { 'address': {'type': 'string'}, 'city': {'type': 'string', 'required': True}, }, }, 'a_dict_with_valuesrules': {'type': 'dict', 'valuesrules': {'type': 'integer'}}, 'a_list_length': { 'type': 'list', 'schema': {'type': 'integer'}, 'minlength': 2, 'maxlength': 5, }, 'a_nullable_field_without_type': {'nullable': True}, 'a_not_nullable_field_without_type': {}, } sample_document = {'name': 'john doe'}
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.03 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A