diff --git a/.coveragerc b/.coveragerc index e176d58bf..bc3093f81 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,6 +2,8 @@ source = dynaconf [report] +show_missing = true +fail_under = 100 omit = */python?.?/* */site-packages/nose/* @@ -11,7 +13,7 @@ omit = dynaconf/loaders/redis_loader.py dynaconf/loaders/vault_loader.py dynaconf/loaders/__init__.py - dynaconf/example/* + dynaconf/tests_functional/* dynaconf/vendor/* dynaconf/vendor_src/* dynaconf/contrib/django_dynaconf/* diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ca7d84cb0..e4127a8ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -181,38 +181,7 @@ jobs: - name: Install project run: pip install --use-deprecated=legacy-resolver .[test] - name: run tests - run: | - pushd example\common & cd & python program.py & popd - pushd example\common-encoding & cd & python program.py & popd - pushd example\ & cd & python full_example.py & popd - pushd example\ & cd & python compat.py & popd - pushd example\app & cd & python app.py & popd - pushd example\app_with_dotenv & cd & python app.py & popd - pushd example\merge_enabled & cd & python app.py & popd - pushd example\new_merge & cd & python app.py & popd - pushd example\dynaconf_merge & cd & python app.py & popd - pushd example\multiple_sources & cd & python app.py & popd - pushd example\multiple_folders & cd & python app.py & popd - pushd example\toml_example\ & cd & python app.py & popd - pushd example\yaml_example\settings_file\ & cd & python app.py & popd - pushd example\yaml_example\yaml_as_extra_config\ & cd & python app.py & popd - pushd example\flask_with_dotenv & cd & flask routes & popd - pushd example\flask_with_toml & cd & flask routes & popd - pushd example\flask_with_yaml & cd & flask routes & popd - pushd example\flask_with_json & cd & flask routes & popd - pushd example\flask_with_commentjson & cd & flask routes & popd - pushd example\flask_with_ini & cd & flask routes & popd - pushd example\validators\with_python\ & cd & python app.py & popd - pushd example\validators\with_toml\ & cd & dynaconf validate & popd - pushd example\toml_with_secrets\ & cd & python program.py & popd - pushd example\envs & cd & python app.py & popd - pushd example\custom_loader & cd & python app.py & popd - pushd example\get_fresh & cd & python app.py & popd - pushd example\includes & cd & python app.py & popd - pushd example\jenkins_secrets_file & cd & python app.py & popd - pushd example\specific_settings_files & cd & python app.py & popd - pushd example\django_example\ & cd & python manage.py test polls -v 2 & popd - pushd example\django_example\ & cd & django-admin test polls -v 2 & popd + run: python tests_functional/runtests.py redis: needs: functional_tests_linux_mac diff --git a/.gitignore b/.gitignore index b2f6f8ab8..25c1b9f12 100644 --- a/.gitignore +++ b/.gitignore @@ -77,8 +77,8 @@ junit/ # django example static files -example/django_example/admin/ -example/django_example/debug_toolbar/ +tests_functional/django_example/admin/ +tests_functional/django_example/debug_toolbar/ # Vendor_src exists only during build process diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 712fbd0f4..7cde11387 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ This Diagram can help you understand visually what happens on Dynaconf: https:// 2. Activate a python3.6+ virtualenv 3. Code 2. Update the `docs/guides/` related to your changes. -3. Update `example/` (editing or adding a new one related to your changes) +3. Update `tests_functional/` (editing or adding a new one related to your changes) 4. Ensure tests are passing (see below `make all`) 1. This project uses `pre-commit` and `Black` for code styling and adequacy tests. 5. Commit, Push and make a Pull Request! @@ -47,8 +47,8 @@ git fetch upstream; git rebase upstream/master # Fix any conflicts if any. # Update docs/guides/ if needed -# Edit example/ if needed -# Create a new app in example/{your_example} and add it to Makefile. +# Edit tests_functional/ if needed +# Create a new app in tests_functional/{your_example} and add it to Makefile. # Then ensure everything is ok make all diff --git a/Makefile b/Makefile index 3bac297e3..8653e5b5c 100644 --- a/Makefile +++ b/Makefile @@ -6,163 +6,20 @@ help: all: clean install run-pre-commit test test_examples coverage-report -test_examples: - @echo '############### Chdir to example directory ###############' - cd example/common;pwd;python program.py - cd example/common-encoding;pwd;python program.py - cd example/simple_ini_example;pwd;TEFLO_LOG_LEVEL=debug python app.py - cd example/;pwd;python full_example.py - cd example/;pwd;python compat.py - cd example/app;pwd;python app.py - cd example/apply_default_on_none;pwd;python app.py - cd example/dunder;pwd;python app.py - cd example/format;pwd;python app.py - cd example/app_with_dotenv;pwd;python app.py - cd example/dotenv_not_loaded_by_default;pwd;python app.py - cd example/dotenv_loaded_if_enabled;pwd;python app.py - cd example/merge_enabled;pwd;python app.py - cd example/new_merge;pwd;python app.py - cd example/overriding;pwd;python app.py - cd example/dynaconf_merge;pwd;python app.py - cd example/multiple_sources;pwd;python app.py - cd example/multiple_folders;pwd;python app.py - cd example/toml_example/;pwd;python app.py - cd example/yaml_example/settings_file/;pwd;python app.py - cd example/yaml_example/yaml_as_extra_config/;pwd;python app.py - cd example/flask_with_dotenv;pwd;flask routes | grep -c flask_with_dotenv || exit 1 - cd example/flask_with_toml;pwd;flask routes | grep -c flask_with_toml || exit 1 - cd example/flask_with_yaml;pwd;flask routes | grep -c flask_with_yaml || exit 1 - cd example/flask_with_json;pwd;flask routes | grep -c flask_with_json || exit 1 - cd example/flask_with_commentjson;pwd;flask routes | grep -c flask_with_commentjson || exit 1 - cd example/flask_with_ini;pwd;flask routes | grep -c flask_with_ini || exit 1 - cd example/pytest_example/app;pwd;python app.py - cd example/pytest_example/app;pwd;pytest tests/ - cd example/pytest_example/flask;pwd;pytest tests - cd example/python_loader;pwd;python app.py - cd example/python_loader_with_hooks;pwd;python app.py - cd example/module_impersonation;pwd;python main.py - cd example/validators/with_python/;pwd;python app.py - cd example/validators/with_toml/;pwd;PYTHONPATH=. dynaconf -i config.settings validate - cd example/toml_with_secrets/;pwd;python program.py - cd example/envs;pwd;python app.py - cd example/envless_mode;pwd;python app.py - cd example/lower_read;pwd;python app.py - cd example/custom_loader;pwd;python app.py - cd example/get_fresh;pwd;python app.py - cd example/includes;pwd;python app.py - cd example/jenkins_secrets_file;pwd;python app.py - cd example/specific_settings_files;pwd;python app.py - cd example/django_example/;pwd;python manage.py test polls -v 2 - cd example/django_pytest/;pwd;pip install pytest-django;DJANGO_SETTINGS_MODULE=project.settings DJANGO_ENVIRONMENT=default pytest;pip uninstall -y pytest-django - cd example/django_example_compat/;pwd;python manage.py test polls -v 2 - cd example/django_example/;pwd;PYTHONPATH=. DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 - cd example/project_root/;pwd;rm -rf /tmp/dynaconf_project_root_test/settings.py;mkdir -p /tmp/dynaconf_project_root_test/;echo "MESSAGE = 'Hello from tmp'" > /tmp/dynaconf_project_root_test/settings.py;python app.py;rm -rf /tmp/dynaconf_project_root_test/ - cd example/settings_file/;pwd;rm -rf /tmp/settings_file_test/settings.py;mkdir -p /tmp/settings_file_test/;echo "MESSAGE = 'Hello from tmp'" > /tmp/settings_file_test/settings.py;python app.py;rm -rf /tmp/settings_file_test/ - cd example/configure/;pwd;rm -rf /tmp/configure_test/settings.py;mkdir -p /tmp/configure_test/;echo "MESSAGE = 'Hello from tmp'" > /tmp/configure_test/settings.py;python app.py;rm -rf /tmp/configure_test/ - cd example/-m_case/;pwd;python -m module - cd example/custom_cast_token;pwd;python app.py - - @echo '############### Calling from outer folder ###############' - python example/common/program.py - python example/common-encoding/program.py - python example/full_example.py - python example/compat.py - python example/app/app.py - python example/app_with_dotenv/app.py - python example/merge_enabled/app.py - python example/dynaconf_merge/app.py - python example/multiple_sources/app.py - python example/multiple_folders/app.py - python example/toml_example/app.py - python example/yaml_example/settings_file/app.py - python example/yaml_example/yaml_as_extra_config/app.py - python example/validators/with_python/app.py - python example/toml_with_secrets/program.py - python example/envs/app.py - python example/custom_loader/app.py - python example/get_fresh/app.py - python example/includes/app.py - python example/jenkins_secrets_file/app.py - python example/specific_settings_files/app.py - python example/django_example/manage.py test polls -v 2 - PYTHONPATH=example/django_example DJANGO_SETTINGS_MODULE=foo.settings python example/django_example/standalone_script.py - PYTHONPATH=example/issues/449_django_lazy_path DJANGO_SETTINGS_MODULE=foo.settings python example/django_example/standalone_script.py - PYTHONPATH=example/django_example_compat DJANGO_SETTINGS_MODULE=foo.settings python example/django_example_compat/standalone_script.py - python example/envvar_prefix/app.py - - @echo '############### Django Admin From root folder ###############' - PYTHONPATH=./example/django_example/ DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 - PYTHONPATH=./example/issues/449_django_lazy_path/ DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 - PYTHONPATH=./example/django_example_compat/ DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 - - @echo '############ Issues ##################' - cd example/issues/160_path_traversal_fixed;pwd;./test.sh - cd example/issues/166_renamed_global_env;pwd;python app.py - cd example/issues/169_renamed_settings_module;pwd;python app.py - cd example/issues/182_multiple_locations;pwd;python app.py - cd example/issues/184_ipython;pwd;./test.sh - cd example/issues/194_flask_config;pwd;python app.py - cd example/issues/228_nested_toml_bool/python_app;pwd;python app.py - cd example/issues/228_nested_toml_bool/django_app;pwd;python manage.py test - cd example/issues/251_dotted_unexistent;pwd;python app.py - cd example/issues/253_set;pwd;python app.py - cd example/issues/266_envvar_from_env_override;pwd;python app.py - cd example/issues/288_null_values;pwd;python app.py - cd example/issues/306_merge_replace;pwd;python app.py - cd example/issues/359_variable_reference;pwd;python app.py - cd example/issues/384_dotted_set;pwd;python app.py - cd example/issues/392_evaluate_nested_structures;pwd;DYNACONF_INITIAL='@merge [1,2,3]' python app.py - cd example/issues/404_dup_validator_message;pwd;python app.py - cd example/issues/434_setenv;pwd;python app.py --config development dynaconf - cd example/issues/430_same_name;pwd;python app.py - cd example/issues/443_object_merge;pwd;python app.py - cd example/issues/445_casting;pwd;python app.py - cd example/issues/467_load_from_parent_folder/src;pwd;python app.py - cd example/issues/478_mispell_environments;pwd;python app.py - cd example/issues/482_layered_format;pwd;python app.py - cd example/issues/486_title_case_validation;pwd;python app.py - cd example/issues/494_using_pathlib;pwd;python app.py - cd example/issues/519_underscore_in_name;pwd;ATC_BLE__device_id=42 EXPECTED_VALUE=42 python app.py - cd example/issues/519_underscore_in_name;pwd;ATC_BLE__DEVICE_ID=42 EXPECTED_VALUE=42 python app.py - cd example/issues/685_disable_dotted_lookup;pwd;python app.py - cd example/issues/709_yaml_merge_with_env;pwd;python app.py - cd example/issues/718_dynaconf_dotted_lookup;pwd;python app.py - cd example/issues/720_load_dotenv;pwd;python src/app/app.py - cd example/issues/722_docs_example;pwd;python app.py - cd example/issues/729_use_default_when_setting_is_blank;pwd;python app.py - cd example/issues/741_envvars_ignored;pwd;sh recreate.sh - cd example/issues/705_flask_dynaconf_init;pwd;make test;make clean - cd example/issues/794_includes;pwd;python app.py - cd example/issues/799_negative_numbers;pwd;DYNACONF_NUM="-1" python app.py +test_functional: + ./tests_functional/runtests.py test_vault: - # @cd example/vault;pwd;python write.py - docker run --rm --name dynaconf_with_vault -d -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' -p 8200:8200 vault || true - @sleep 5 - @cd example/vault;pwd;dynaconf -i dynaconf.settings write vault -s SECRET=vault_works_in_default -s FOO=foo_is_default - @cd example/vault;pwd;dynaconf -i dynaconf.settings write vault -e dev -s SECRET=vault_works_in_dev - @cd example/vault;pwd;dynaconf -i dynaconf.settings write vault -e prod -s SECRET=vault_works_in_prod - @sleep 2 - @cd example/vault;pwd;python vault_example.py - docker stop dynaconf_with_vault || true + ./tests_functional/test_vault.sh test_redis: - # @cd example/redis_example;pwd;python write.py - docker run --rm --name dynaconf_with_redis -d -p 6379:6379 redis:alpine || true - @sleep 2 - @cd example/redis_example;pwd;dynaconf -i dynaconf.settings write redis -s FOO=foo_is_default - @cd example/redis_example;pwd;dynaconf -i dynaconf.settings write redis -s SECRET=redis_works_in_default - @cd example/redis_example;pwd;dynaconf -i dynaconf.settings write redis -e development -s SECRET=redis_works_in_development - @cd example/redis_example;pwd;dynaconf -i dynaconf.settings write redis -e production -s SECRET=redis_works_in_production - @sleep 2 - @cd example/redis_example;pwd;python redis_example.py - docker stop dynaconf_with_redis || true + ./tests_functional/test_redis.sh watch: ls **/**.py | entr py.test -m "not integration" -s -vvv -l --tb=long --maxfail=1 tests/ watch_django: - ls {**/**.py,~/.virtualenvs/dynaconf/**/**.py,.venv/**/**.py} | PYTHON_PATH=. DJANGO_SETTINGS_MODULE=foo.settings entr example/django_example/manage.py test polls -v 2 + ls {**/**.py,~/.virtualenvs/dynaconf/**/**.py,.venv/**/**.py} | PYTHON_PATH=. DJANGO_SETTINGS_MODULE=foo.settings entr tests_functional/django_example/manage.py test polls -v 2 watch_coverage: ls {**/**.py,~/.virtualenvs/dynaconf/**/**.py} | entr -s "make test;coverage html" @@ -176,7 +33,7 @@ test_integration: coverage xml coverage-report: - coverage report --fail-under=100 + coverage report mypy: mypy dynaconf/ --exclude '^dynaconf/vendor*' @@ -186,6 +43,7 @@ test: pep8 mypy test_only citest: py.test -v --cov-config .coveragerc --cov=dynaconf -l tests/ --junitxml=junit/test-results.xml coverage xml + make coverage-report ciinstall: python -m pip install --upgrade pip diff --git a/docs/advanced.md b/docs/advanced.md index 50d60380d..d5cb639ca 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -167,7 +167,7 @@ def load( obj._loaded_files.append(sops_file) ``` -See more [example/custom_loader](https://github.com/dynaconf/dynaconf/tree/master/example/custom_loader) +See more [tests_functional/custom_loader](https://github.com/dynaconf/dynaconf/tree/master/tests_functional/custom_loader) ## Module impersonation @@ -413,7 +413,7 @@ Then your `program.py` will print `"On Testing"` red from `[testing]` environmen For pytest it is common to create fixtures to provide pre-configured settings object or to configure the settings before all the tests are collected. -Examples available on [https://github.com/dynaconf/dynaconf/tree/master/example/pytest_example](https://github.com/dynaconf/dynaconf/tree/master/example/pytest_example) +Examples available on [https://github.com/dynaconf/dynaconf/tree/master/tests_functional/pytest_example](https://github.com/dynaconf/dynaconf/tree/master/tests_functional/pytest_example) With `pytest` fixtures it is recommended to use the `FORCE_ENV_FOR_DYNACONF` instead of just `ENV_FOR_DYNACONF` because it has precedence. diff --git a/docs/django.md b/docs/django.md index 7c501c91b..7aee77b41 100644 --- a/docs/django.md +++ b/docs/django.md @@ -32,7 +32,7 @@ $ dynaconf init --django yourapp/settings.py Dynaconf will append its extension loading code to the bottom of your `yourapp/settings.py` file and will create `settings.toml` and `.secrets.toml` in the current folder (the same where `manage.py` is located). -> **TIP** Take a look at [example/django_example](https://github.com/dynaconf/dynaconf/tree/master/example/django_example) +> **TIP** Take a look at [tests_functional/django_example](https://github.com/dynaconf/dynaconf/tree/master/tests_functional/django_example) ## Using `DJANGO_` environment variables diff --git a/dynaconf/cli.py b/dynaconf/cli.py index b60caad77..47745d0d7 100644 --- a/dynaconf/cli.py +++ b/dynaconf/cli.py @@ -1,7 +1,6 @@ from __future__ import annotations import importlib -import io import os import pprint import sys @@ -264,6 +263,19 @@ def init(ctx, fileformat, path, env, _vars, _secrets, wg, y, django): """ click.echo("⚙️ Configuring your Dynaconf environment") click.echo("-" * 42) + if "FLASK_APP" in os.environ: # pragma: no cover + click.echo( + "⚠️ Flask detected, you can't use `dynaconf init` " + "on a flask project, instead go to dynaconf.com/flask/ " + "for more information.\n" + "Or add the following to your app.py\n" + "\n" + "from dynaconf import FlaskDynaconf\n" + "app = Flask(__name__)\n" + "FlaskDynaconf(app)\n" + ) + exit(1) + path = Path(path) if env is not None: diff --git a/example/issues/519_underscore_in_name/settings.yml b/example/issues/519_underscore_in_name/settings.yml deleted file mode 100644 index 50eddd338..000000000 --- a/example/issues/519_underscore_in_name/settings.yml +++ /dev/null @@ -1,2 +0,0 @@ -ble: - device_id: 0 diff --git a/example/issues/705_flask_dynaconf_init/Makefile b/example/issues/705_flask_dynaconf_init/Makefile deleted file mode 100644 index 0ce162e2e..000000000 --- a/example/issues/705_flask_dynaconf_init/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -.PHONY: test clean - -export FLASK_APP=app:create_app - -test: clean - dynaconf init -v test_var - grep '\[development\]' settings.toml - -clean: - rm -rf settings.toml - rm -rf .secrets.toml - rm -rf .gitignore diff --git a/example/issues/799_negative_numbers/settings.toml b/example/issues/799_negative_numbers/settings.toml deleted file mode 100644 index e32e0e065..000000000 --- a/example/issues/799_negative_numbers/settings.toml +++ /dev/null @@ -1 +0,0 @@ -num = -1 diff --git a/tests/test_flask.py b/tests/test_flask.py index ecafd4a65..fbd40d17c 100644 --- a/tests/test_flask.py +++ b/tests/test_flask.py @@ -6,7 +6,7 @@ from flask import Flask from dynaconf.contrib import FlaskDynaconf -from example.flask_with_dotenv.app import app as flask_app +from tests_functional.flask_with_dotenv.app import app as flask_app DBDATA = namedtuple("DbData", ["server", "port"]) @@ -33,11 +33,13 @@ def test_named_tuple_config_using_initapp(): def test_dynamic_load_exts(settings): """Assert that a config based extensions are loaded""" app = Flask(__name__) - app.config["EXTENSIONS"] = ["example.dummy_flask_extension.dummy:init_app"] + app.config["EXTENSIONS"] = [ + "tests_functional.dummy_flask_extension.dummy:init_app" + ] FlaskDynaconf(app, dynaconf_instance=settings) app.config.load_extensions() assert app.config.EXTENSIONS == [ - "example.dummy_flask_extension.dummy:init_app" + "tests_functional.dummy_flask_extension.dummy:init_app" ] assert app.is_dummy_loaded is True @@ -46,12 +48,12 @@ def test_dynamic_load_entry_point(settings): """Assert that a config based extensions support entry point syntax""" app = Flask(__name__) app.config["EXTENSIONS"] = [ - "example.dummy_flask_extension:dummy_instance.init_app" + "tests_functional.dummy_flask_extension:dummy_instance.init_app" ] FlaskDynaconf(app, dynaconf_instance=settings) app.config.load_extensions() assert app.config.EXTENSIONS == [ - "example.dummy_flask_extension:dummy_instance.init_app" + "tests_functional.dummy_flask_extension:dummy_instance.init_app" ] assert app.extensions["dummy"].__class__.__name__ == "DummyExtensionType" @@ -59,10 +61,12 @@ def test_dynamic_load_entry_point(settings): def test_dynamic_load_exts_list(settings): """Assert that a config based extensions are loaded""" app = Flask(__name__) - app.config["EXTENSIONS"] = ["example.dummy_flask_extension.dummy:init_app"] + app.config["EXTENSIONS"] = [ + "tests_functional.dummy_flask_extension.dummy:init_app" + ] FlaskDynaconf(app, dynaconf_instance=settings, extensions_list=True) assert app.config.EXTENSIONS == [ - "example.dummy_flask_extension.dummy:init_app" + "tests_functional.dummy_flask_extension.dummy:init_app" ] assert app.is_dummy_loaded is True diff --git a/tests_functional/-m_case/Makefile b/tests_functional/-m_case/Makefile new file mode 100644 index 000000000..1c9e9a405 --- /dev/null +++ b/tests_functional/-m_case/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python -m module diff --git a/example/-m_case/module/__init__.py b/tests_functional/-m_case/module/__init__.py similarity index 100% rename from example/-m_case/module/__init__.py rename to tests_functional/-m_case/module/__init__.py diff --git a/example/-m_case/module/__main__.py b/tests_functional/-m_case/module/__main__.py similarity index 100% rename from example/-m_case/module/__main__.py rename to tests_functional/-m_case/module/__main__.py diff --git a/example/-m_case/module/config/settings.toml b/tests_functional/-m_case/module/config/settings.toml similarity index 100% rename from example/-m_case/module/config/settings.toml rename to tests_functional/-m_case/module/config/settings.toml diff --git a/example/__init__.py b/tests_functional/__init__.py similarity index 100% rename from example/__init__.py rename to tests_functional/__init__.py diff --git a/example/app/.env b/tests_functional/app/.env similarity index 100% rename from example/app/.env rename to tests_functional/app/.env diff --git a/example/app/Makefile b/tests_functional/app/Makefile similarity index 100% rename from example/app/Makefile rename to tests_functional/app/Makefile diff --git a/example/app/__init__.py b/tests_functional/app/__init__.py similarity index 100% rename from example/app/__init__.py rename to tests_functional/app/__init__.py diff --git a/example/app/app.py b/tests_functional/app/app.py similarity index 100% rename from example/app/app.py rename to tests_functional/app/app.py diff --git a/tests_functional/app/env.toml b/tests_functional/app/env.toml new file mode 100644 index 000000000..fae9a51b7 --- /dev/null +++ b/tests_functional/app/env.toml @@ -0,0 +1 @@ +FOO = "BAR" diff --git a/example/app/mysettings.py b/tests_functional/app/mysettings.py similarity index 100% rename from example/app/mysettings.py rename to tests_functional/app/mysettings.py diff --git a/example/app_with_dotenv/.env b/tests_functional/app_with_dotenv/.env similarity index 100% rename from example/app_with_dotenv/.env rename to tests_functional/app_with_dotenv/.env diff --git a/tests_functional/app_with_dotenv/Makefile b/tests_functional/app_with_dotenv/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/app_with_dotenv/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/app_with_dotenv/__init__.py b/tests_functional/app_with_dotenv/__init__.py similarity index 100% rename from example/app_with_dotenv/__init__.py rename to tests_functional/app_with_dotenv/__init__.py diff --git a/example/app_with_dotenv/app.py b/tests_functional/app_with_dotenv/app.py similarity index 100% rename from example/app_with_dotenv/app.py rename to tests_functional/app_with_dotenv/app.py diff --git a/example/apply_default_on_none/app.py b/tests_functional/apply_default_on_none/app.py similarity index 100% rename from example/apply_default_on_none/app.py rename to tests_functional/apply_default_on_none/app.py diff --git a/example/apply_default_on_none/settings.yaml b/tests_functional/apply_default_on_none/settings.yaml similarity index 100% rename from example/apply_default_on_none/settings.yaml rename to tests_functional/apply_default_on_none/settings.yaml diff --git a/example/common-encoding/.env b/tests_functional/common-encoding/.env similarity index 100% rename from example/common-encoding/.env rename to tests_functional/common-encoding/.env diff --git a/example/common-encoding/.secrets.toml b/tests_functional/common-encoding/.secrets.toml similarity index 100% rename from example/common-encoding/.secrets.toml rename to tests_functional/common-encoding/.secrets.toml diff --git a/tests_functional/common-encoding/Makefile b/tests_functional/common-encoding/Makefile new file mode 100644 index 000000000..dbc66112b --- /dev/null +++ b/tests_functional/common-encoding/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python program.py diff --git a/example/common-encoding/program.py b/tests_functional/common-encoding/program.py similarity index 100% rename from example/common-encoding/program.py rename to tests_functional/common-encoding/program.py diff --git a/example/common-encoding/settings.toml b/tests_functional/common-encoding/settings.toml similarity index 100% rename from example/common-encoding/settings.toml rename to tests_functional/common-encoding/settings.toml diff --git a/example/common/.env b/tests_functional/common/.env similarity index 100% rename from example/common/.env rename to tests_functional/common/.env diff --git a/example/common/.secrets.toml b/tests_functional/common/.secrets.toml similarity index 100% rename from example/common/.secrets.toml rename to tests_functional/common/.secrets.toml diff --git a/tests_functional/common/Makefile b/tests_functional/common/Makefile new file mode 100644 index 000000000..dbc66112b --- /dev/null +++ b/tests_functional/common/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python program.py diff --git a/example/common/program.py b/tests_functional/common/program.py similarity index 100% rename from example/common/program.py rename to tests_functional/common/program.py diff --git a/example/common/settings.toml b/tests_functional/common/settings.toml similarity index 100% rename from example/common/settings.toml rename to tests_functional/common/settings.toml diff --git a/example/compat.py b/tests_functional/compat/app.py similarity index 100% rename from example/compat.py rename to tests_functional/compat/app.py diff --git a/example/configure/.env b/tests_functional/configure/.env similarity index 100% rename from example/configure/.env rename to tests_functional/configure/.env diff --git a/tests_functional/configure/Makefile b/tests_functional/configure/Makefile new file mode 100644 index 000000000..3a82ead5a --- /dev/null +++ b/tests_functional/configure/Makefile @@ -0,0 +1,8 @@ +.PHONY: test + +test: + rm -rf /tmp/configure_test/settings.py + mkdir -p /tmp/configure_test/ + echo "MESSAGE = 'Hello from tmp'" > /tmp/configure_test/settings.py + python app.py + rm -rf /tmp/configure_test/ diff --git a/example/configure/app.py b/tests_functional/configure/app.py similarity index 100% rename from example/configure/app.py rename to tests_functional/configure/app.py diff --git a/example/custom_cast_token/app.py b/tests_functional/custom_cast_token/app.py similarity index 100% rename from example/custom_cast_token/app.py rename to tests_functional/custom_cast_token/app.py diff --git a/example/custom_cast_token/settings.toml b/tests_functional/custom_cast_token/settings.toml similarity index 100% rename from example/custom_cast_token/settings.toml rename to tests_functional/custom_cast_token/settings.toml diff --git a/example/custom_loader/.env b/tests_functional/custom_loader/.env similarity index 100% rename from example/custom_loader/.env rename to tests_functional/custom_loader/.env diff --git a/tests_functional/custom_loader/Makefile b/tests_functional/custom_loader/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/custom_loader/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/custom_loader/app.py b/tests_functional/custom_loader/app.py similarity index 100% rename from example/custom_loader/app.py rename to tests_functional/custom_loader/app.py diff --git a/example/custom_loader/my_custom_loader/__init__.py b/tests_functional/custom_loader/my_custom_loader/__init__.py similarity index 100% rename from example/custom_loader/my_custom_loader/__init__.py rename to tests_functional/custom_loader/my_custom_loader/__init__.py diff --git a/example/custom_loader/my_custom_loader/sff_loader.py b/tests_functional/custom_loader/my_custom_loader/sff_loader.py similarity index 100% rename from example/custom_loader/my_custom_loader/sff_loader.py rename to tests_functional/custom_loader/my_custom_loader/sff_loader.py diff --git a/example/custom_loader/requirements.txt b/tests_functional/custom_loader/requirements.txt similarity index 100% rename from example/custom_loader/requirements.txt rename to tests_functional/custom_loader/requirements.txt diff --git a/example/custom_loader/settings.sff b/tests_functional/custom_loader/settings.sff similarity index 100% rename from example/custom_loader/settings.sff rename to tests_functional/custom_loader/settings.sff diff --git a/tests_functional/debug/Makefile b/tests_functional/debug/Makefile new file mode 100644 index 000000000..0bd845ef5 --- /dev/null +++ b/tests_functional/debug/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + echo "this is a utility only for debugging" diff --git a/example/debug/app.py b/tests_functional/debug/debug.py similarity index 100% rename from example/debug/app.py rename to tests_functional/debug/debug.py diff --git a/example/debug/settings.toml b/tests_functional/debug/settings.toml similarity index 100% rename from example/debug/settings.toml rename to tests_functional/debug/settings.toml diff --git a/example/django_example/.env b/tests_functional/django_example/.env similarity index 100% rename from example/django_example/.env rename to tests_functional/django_example/.env diff --git a/example/django_example/.secrets.yaml b/tests_functional/django_example/.secrets.yaml similarity index 100% rename from example/django_example/.secrets.yaml rename to tests_functional/django_example/.secrets.yaml diff --git a/tests_functional/django_example/Makefile b/tests_functional/django_example/Makefile new file mode 100644 index 000000000..33979a94e --- /dev/null +++ b/tests_functional/django_example/Makefile @@ -0,0 +1,8 @@ +.PHONY: test + +test: + python manage.py test polls -v 2 + PYTHONPATH=. DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 + cd ../../;python tests_functional/django_example/manage.py test polls -v 2 + cd ../../;PYTHONPATH=tests_functional/django_example/ DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 + PYTHONPATH=. DJANGO_SETTINGS_MODULE=foo.settings python standalone_script.py diff --git a/example/django_example/foo/__init__.py b/tests_functional/django_example/foo/__init__.py similarity index 100% rename from example/django_example/foo/__init__.py rename to tests_functional/django_example/foo/__init__.py diff --git a/example/django_example/foo/a_plugin_folder/__init__.py b/tests_functional/django_example/foo/a_plugin_folder/__init__.py similarity index 100% rename from example/django_example/foo/a_plugin_folder/__init__.py rename to tests_functional/django_example/foo/a_plugin_folder/__init__.py diff --git a/example/django_example/foo/a_plugin_folder/dynaconf_hooks.py b/tests_functional/django_example/foo/a_plugin_folder/dynaconf_hooks.py similarity index 100% rename from example/django_example/foo/a_plugin_folder/dynaconf_hooks.py rename to tests_functional/django_example/foo/a_plugin_folder/dynaconf_hooks.py diff --git a/example/django_example/foo/a_plugin_folder/settings.py b/tests_functional/django_example/foo/a_plugin_folder/settings.py similarity index 100% rename from example/django_example/foo/a_plugin_folder/settings.py rename to tests_functional/django_example/foo/a_plugin_folder/settings.py diff --git a/example/django_example/foo/dynaconf_hooks.py b/tests_functional/django_example/foo/dynaconf_hooks.py similarity index 100% rename from example/django_example/foo/dynaconf_hooks.py rename to tests_functional/django_example/foo/dynaconf_hooks.py diff --git a/example/django_example/foo/settings.py b/tests_functional/django_example/foo/settings.py similarity index 100% rename from example/django_example/foo/settings.py rename to tests_functional/django_example/foo/settings.py diff --git a/example/django_example/foo/urls.py b/tests_functional/django_example/foo/urls.py similarity index 100% rename from example/django_example/foo/urls.py rename to tests_functional/django_example/foo/urls.py diff --git a/example/django_example/foo/wsgi.py b/tests_functional/django_example/foo/wsgi.py similarity index 100% rename from example/django_example/foo/wsgi.py rename to tests_functional/django_example/foo/wsgi.py diff --git a/example/django_example/manage.py b/tests_functional/django_example/manage.py similarity index 100% rename from example/django_example/manage.py rename to tests_functional/django_example/manage.py diff --git a/example/django_example/polls/__init__.py b/tests_functional/django_example/polls/__init__.py similarity index 100% rename from example/django_example/polls/__init__.py rename to tests_functional/django_example/polls/__init__.py diff --git a/example/django_example/polls/admin.py b/tests_functional/django_example/polls/admin.py similarity index 100% rename from example/django_example/polls/admin.py rename to tests_functional/django_example/polls/admin.py diff --git a/example/django_example/polls/apps.py b/tests_functional/django_example/polls/apps.py similarity index 100% rename from example/django_example/polls/apps.py rename to tests_functional/django_example/polls/apps.py diff --git a/example/django_example/polls/migrations/__init__.py b/tests_functional/django_example/polls/migrations/__init__.py similarity index 100% rename from example/django_example/polls/migrations/__init__.py rename to tests_functional/django_example/polls/migrations/__init__.py diff --git a/example/django_example/polls/models.py b/tests_functional/django_example/polls/models.py similarity index 100% rename from example/django_example/polls/models.py rename to tests_functional/django_example/polls/models.py diff --git a/example/django_example/polls/tests.py b/tests_functional/django_example/polls/tests.py similarity index 100% rename from example/django_example/polls/tests.py rename to tests_functional/django_example/polls/tests.py diff --git a/example/django_example/polls/urls.py b/tests_functional/django_example/polls/urls.py similarity index 100% rename from example/django_example/polls/urls.py rename to tests_functional/django_example/polls/urls.py diff --git a/example/django_example/polls/views.py b/tests_functional/django_example/polls/views.py similarity index 100% rename from example/django_example/polls/views.py rename to tests_functional/django_example/polls/views.py diff --git a/example/django_example/pulpsettings.py b/tests_functional/django_example/pulpsettings.py similarity index 100% rename from example/django_example/pulpsettings.py rename to tests_functional/django_example/pulpsettings.py diff --git a/example/django_example/settings.yaml b/tests_functional/django_example/settings.yaml similarity index 100% rename from example/django_example/settings.yaml rename to tests_functional/django_example/settings.yaml diff --git a/example/django_example/standalone_script.py b/tests_functional/django_example/standalone_script.py similarity index 100% rename from example/django_example/standalone_script.py rename to tests_functional/django_example/standalone_script.py diff --git a/tests_functional/django_example_compat/Makefile b/tests_functional/django_example_compat/Makefile new file mode 100644 index 000000000..fb331e75b --- /dev/null +++ b/tests_functional/django_example_compat/Makefile @@ -0,0 +1,8 @@ +.PHONY: test + +test: + python manage.py test polls -v 2 + PYTHONPATH=. DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 + cd ../../;python tests_functional/django_example_compat/manage.py test polls -v 2 + cd ../../;PYTHONPATH=tests_functional/django_example_compat/ DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 + PYTHONPATH=. DJANGO_SETTINGS_MODULE=foo.settings python standalone_script.py diff --git a/example/django_example_compat/config/.env b/tests_functional/django_example_compat/config/.env similarity index 100% rename from example/django_example_compat/config/.env rename to tests_functional/django_example_compat/config/.env diff --git a/example/django_example_compat/config/.secrets.yaml b/tests_functional/django_example_compat/config/.secrets.yaml similarity index 100% rename from example/django_example_compat/config/.secrets.yaml rename to tests_functional/django_example_compat/config/.secrets.yaml diff --git a/example/django_example_compat/config/settings.yaml b/tests_functional/django_example_compat/config/settings.yaml similarity index 100% rename from example/django_example_compat/config/settings.yaml rename to tests_functional/django_example_compat/config/settings.yaml diff --git a/example/django_example_compat/foo/__init__.py b/tests_functional/django_example_compat/foo/__init__.py similarity index 100% rename from example/django_example_compat/foo/__init__.py rename to tests_functional/django_example_compat/foo/__init__.py diff --git a/example/django_example_compat/foo/settings.py b/tests_functional/django_example_compat/foo/settings.py similarity index 100% rename from example/django_example_compat/foo/settings.py rename to tests_functional/django_example_compat/foo/settings.py diff --git a/example/django_example_compat/foo/urls.py b/tests_functional/django_example_compat/foo/urls.py similarity index 100% rename from example/django_example_compat/foo/urls.py rename to tests_functional/django_example_compat/foo/urls.py diff --git a/example/django_example_compat/foo/wsgi.py b/tests_functional/django_example_compat/foo/wsgi.py similarity index 100% rename from example/django_example_compat/foo/wsgi.py rename to tests_functional/django_example_compat/foo/wsgi.py diff --git a/example/django_example_compat/includes/plugin_settings.py b/tests_functional/django_example_compat/includes/plugin_settings.py similarity index 100% rename from example/django_example_compat/includes/plugin_settings.py rename to tests_functional/django_example_compat/includes/plugin_settings.py diff --git a/example/django_example_compat/manage.py b/tests_functional/django_example_compat/manage.py similarity index 100% rename from example/django_example_compat/manage.py rename to tests_functional/django_example_compat/manage.py diff --git a/example/django_example_compat/polls/__init__.py b/tests_functional/django_example_compat/polls/__init__.py similarity index 100% rename from example/django_example_compat/polls/__init__.py rename to tests_functional/django_example_compat/polls/__init__.py diff --git a/example/django_example_compat/polls/admin.py b/tests_functional/django_example_compat/polls/admin.py similarity index 100% rename from example/django_example_compat/polls/admin.py rename to tests_functional/django_example_compat/polls/admin.py diff --git a/example/django_example_compat/polls/apps.py b/tests_functional/django_example_compat/polls/apps.py similarity index 100% rename from example/django_example_compat/polls/apps.py rename to tests_functional/django_example_compat/polls/apps.py diff --git a/example/django_example_compat/polls/migrations/__init__.py b/tests_functional/django_example_compat/polls/migrations/__init__.py similarity index 100% rename from example/django_example_compat/polls/migrations/__init__.py rename to tests_functional/django_example_compat/polls/migrations/__init__.py diff --git a/example/django_example_compat/polls/models.py b/tests_functional/django_example_compat/polls/models.py similarity index 100% rename from example/django_example_compat/polls/models.py rename to tests_functional/django_example_compat/polls/models.py diff --git a/example/django_example_compat/polls/tests.py b/tests_functional/django_example_compat/polls/tests.py similarity index 100% rename from example/django_example_compat/polls/tests.py rename to tests_functional/django_example_compat/polls/tests.py diff --git a/example/django_example_compat/polls/urls.py b/tests_functional/django_example_compat/polls/urls.py similarity index 100% rename from example/django_example_compat/polls/urls.py rename to tests_functional/django_example_compat/polls/urls.py diff --git a/example/django_example_compat/polls/views.py b/tests_functional/django_example_compat/polls/views.py similarity index 100% rename from example/django_example_compat/polls/views.py rename to tests_functional/django_example_compat/polls/views.py diff --git a/example/django_example_compat/standalone_script.py b/tests_functional/django_example_compat/standalone_script.py similarity index 100% rename from example/django_example_compat/standalone_script.py rename to tests_functional/django_example_compat/standalone_script.py diff --git a/tests_functional/django_pure/Makefile b/tests_functional/django_pure/Makefile new file mode 100644 index 000000000..fa8e2a83c --- /dev/null +++ b/tests_functional/django_pure/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python manage.py test polls -v 2 diff --git a/example/django_pure/foo/__init__.py b/tests_functional/django_pure/foo/__init__.py similarity index 100% rename from example/django_pure/foo/__init__.py rename to tests_functional/django_pure/foo/__init__.py diff --git a/example/django_pure/foo/settings.py b/tests_functional/django_pure/foo/settings.py similarity index 100% rename from example/django_pure/foo/settings.py rename to tests_functional/django_pure/foo/settings.py diff --git a/example/django_pure/foo/urls.py b/tests_functional/django_pure/foo/urls.py similarity index 100% rename from example/django_pure/foo/urls.py rename to tests_functional/django_pure/foo/urls.py diff --git a/example/django_pure/foo/wsgi.py b/tests_functional/django_pure/foo/wsgi.py similarity index 100% rename from example/django_pure/foo/wsgi.py rename to tests_functional/django_pure/foo/wsgi.py diff --git a/example/django_pure/manage.py b/tests_functional/django_pure/manage.py similarity index 100% rename from example/django_pure/manage.py rename to tests_functional/django_pure/manage.py diff --git a/example/django_pure/polls/__init__.py b/tests_functional/django_pure/polls/__init__.py similarity index 100% rename from example/django_pure/polls/__init__.py rename to tests_functional/django_pure/polls/__init__.py diff --git a/example/django_pure/polls/admin.py b/tests_functional/django_pure/polls/admin.py similarity index 100% rename from example/django_pure/polls/admin.py rename to tests_functional/django_pure/polls/admin.py diff --git a/example/django_pure/polls/apps.py b/tests_functional/django_pure/polls/apps.py similarity index 100% rename from example/django_pure/polls/apps.py rename to tests_functional/django_pure/polls/apps.py diff --git a/example/django_pure/polls/migrations/__init__.py b/tests_functional/django_pure/polls/migrations/__init__.py similarity index 100% rename from example/django_pure/polls/migrations/__init__.py rename to tests_functional/django_pure/polls/migrations/__init__.py diff --git a/example/django_pure/polls/models.py b/tests_functional/django_pure/polls/models.py similarity index 100% rename from example/django_pure/polls/models.py rename to tests_functional/django_pure/polls/models.py diff --git a/example/django_pure/polls/tests.py b/tests_functional/django_pure/polls/tests.py similarity index 100% rename from example/django_pure/polls/tests.py rename to tests_functional/django_pure/polls/tests.py diff --git a/example/django_pure/polls/urls.py b/tests_functional/django_pure/polls/urls.py similarity index 100% rename from example/django_pure/polls/urls.py rename to tests_functional/django_pure/polls/urls.py diff --git a/example/django_pure/polls/views.py b/tests_functional/django_pure/polls/views.py similarity index 100% rename from example/django_pure/polls/views.py rename to tests_functional/django_pure/polls/views.py diff --git a/example/django_pure/settings.yaml b/tests_functional/django_pure/settings.yaml similarity index 100% rename from example/django_pure/settings.yaml rename to tests_functional/django_pure/settings.yaml diff --git a/example/django_pure/standalone_script.py b/tests_functional/django_pure/standalone_script.py similarity index 100% rename from example/django_pure/standalone_script.py rename to tests_functional/django_pure/standalone_script.py diff --git a/example/django_pytest/.env b/tests_functional/django_pytest/.env similarity index 100% rename from example/django_pytest/.env rename to tests_functional/django_pytest/.env diff --git a/example/django_pytest/.gitignore b/tests_functional/django_pytest/.gitignore similarity index 100% rename from example/django_pytest/.gitignore rename to tests_functional/django_pytest/.gitignore diff --git a/tests_functional/django_pytest/Makefile b/tests_functional/django_pytest/Makefile new file mode 100644 index 000000000..7926308ec --- /dev/null +++ b/tests_functional/django_pytest/Makefile @@ -0,0 +1,6 @@ +.PHONY: test + +test: + pip install pytest-django + DJANGO_SETTINGS_MODULE=project.settings DJANGO_ENVIRONMENT=default pytest + pip uninstall -y pytest-django diff --git a/example/django_pytest/README.md b/tests_functional/django_pytest/README.md similarity index 100% rename from example/django_pytest/README.md rename to tests_functional/django_pytest/README.md diff --git a/example/django_pytest/app/__init__.py b/tests_functional/django_pytest/app/__init__.py similarity index 100% rename from example/django_pytest/app/__init__.py rename to tests_functional/django_pytest/app/__init__.py diff --git a/example/django_pytest/app/admin.py b/tests_functional/django_pytest/app/admin.py similarity index 100% rename from example/django_pytest/app/admin.py rename to tests_functional/django_pytest/app/admin.py diff --git a/example/django_pytest/app/apps.py b/tests_functional/django_pytest/app/apps.py similarity index 100% rename from example/django_pytest/app/apps.py rename to tests_functional/django_pytest/app/apps.py diff --git a/example/django_pytest/app/migrations/__init__.py b/tests_functional/django_pytest/app/migrations/__init__.py similarity index 100% rename from example/django_pytest/app/migrations/__init__.py rename to tests_functional/django_pytest/app/migrations/__init__.py diff --git a/example/django_pytest/app/models.py b/tests_functional/django_pytest/app/models.py similarity index 100% rename from example/django_pytest/app/models.py rename to tests_functional/django_pytest/app/models.py diff --git a/example/django_pytest/app/templates/hello.html b/tests_functional/django_pytest/app/templates/hello.html similarity index 100% rename from example/django_pytest/app/templates/hello.html rename to tests_functional/django_pytest/app/templates/hello.html diff --git a/example/django_pytest/app/tests/__init__.py b/tests_functional/django_pytest/app/tests/__init__.py similarity index 100% rename from example/django_pytest/app/tests/__init__.py rename to tests_functional/django_pytest/app/tests/__init__.py diff --git a/example/django_pytest/app/tests/conftest.py b/tests_functional/django_pytest/app/tests/conftest.py similarity index 100% rename from example/django_pytest/app/tests/conftest.py rename to tests_functional/django_pytest/app/tests/conftest.py diff --git a/example/django_pytest/app/tests/test_app.py b/tests_functional/django_pytest/app/tests/test_app.py similarity index 100% rename from example/django_pytest/app/tests/test_app.py rename to tests_functional/django_pytest/app/tests/test_app.py diff --git a/example/django_pytest/app/urls.py b/tests_functional/django_pytest/app/urls.py similarity index 100% rename from example/django_pytest/app/urls.py rename to tests_functional/django_pytest/app/urls.py diff --git a/example/django_pytest/app/views.py b/tests_functional/django_pytest/app/views.py similarity index 100% rename from example/django_pytest/app/views.py rename to tests_functional/django_pytest/app/views.py diff --git a/example/django_pytest/manage.py b/tests_functional/django_pytest/manage.py similarity index 100% rename from example/django_pytest/manage.py rename to tests_functional/django_pytest/manage.py diff --git a/example/django_pytest/project/__init__.py b/tests_functional/django_pytest/project/__init__.py similarity index 100% rename from example/django_pytest/project/__init__.py rename to tests_functional/django_pytest/project/__init__.py diff --git a/example/django_pytest/project/fixtures/admin.json b/tests_functional/django_pytest/project/fixtures/admin.json similarity index 100% rename from example/django_pytest/project/fixtures/admin.json rename to tests_functional/django_pytest/project/fixtures/admin.json diff --git a/example/django_pytest/project/settings.py b/tests_functional/django_pytest/project/settings.py similarity index 100% rename from example/django_pytest/project/settings.py rename to tests_functional/django_pytest/project/settings.py diff --git a/example/django_pytest/project/settings.yaml b/tests_functional/django_pytest/project/settings.yaml similarity index 100% rename from example/django_pytest/project/settings.yaml rename to tests_functional/django_pytest/project/settings.yaml diff --git a/example/django_pytest/project/urls.py b/tests_functional/django_pytest/project/urls.py similarity index 100% rename from example/django_pytest/project/urls.py rename to tests_functional/django_pytest/project/urls.py diff --git a/example/django_pytest/project/wsgi.py b/tests_functional/django_pytest/project/wsgi.py similarity index 100% rename from example/django_pytest/project/wsgi.py rename to tests_functional/django_pytest/project/wsgi.py diff --git a/example/django_pytest/pytest.ini b/tests_functional/django_pytest/pytest.ini similarity index 100% rename from example/django_pytest/pytest.ini rename to tests_functional/django_pytest/pytest.ini diff --git a/example/django_pytest/setup.sh b/tests_functional/django_pytest/setup.sh similarity index 100% rename from example/django_pytest/setup.sh rename to tests_functional/django_pytest/setup.sh diff --git a/example/django_pytest/tests.sh b/tests_functional/django_pytest/tests.sh similarity index 100% rename from example/django_pytest/tests.sh rename to tests_functional/django_pytest/tests.sh diff --git a/example/django_pytest_pure/.env b/tests_functional/django_pytest_pure/.env similarity index 100% rename from example/django_pytest_pure/.env rename to tests_functional/django_pytest_pure/.env diff --git a/example/django_pytest_pure/.gitignore b/tests_functional/django_pytest_pure/.gitignore similarity index 100% rename from example/django_pytest_pure/.gitignore rename to tests_functional/django_pytest_pure/.gitignore diff --git a/tests_functional/django_pytest_pure/Makefile b/tests_functional/django_pytest_pure/Makefile new file mode 100644 index 000000000..7926308ec --- /dev/null +++ b/tests_functional/django_pytest_pure/Makefile @@ -0,0 +1,6 @@ +.PHONY: test + +test: + pip install pytest-django + DJANGO_SETTINGS_MODULE=project.settings DJANGO_ENVIRONMENT=default pytest + pip uninstall -y pytest-django diff --git a/example/django_pytest_pure/README.md b/tests_functional/django_pytest_pure/README.md similarity index 100% rename from example/django_pytest_pure/README.md rename to tests_functional/django_pytest_pure/README.md diff --git a/example/django_pytest_pure/app/__init__.py b/tests_functional/django_pytest_pure/app/__init__.py similarity index 100% rename from example/django_pytest_pure/app/__init__.py rename to tests_functional/django_pytest_pure/app/__init__.py diff --git a/example/django_pytest_pure/app/admin.py b/tests_functional/django_pytest_pure/app/admin.py similarity index 100% rename from example/django_pytest_pure/app/admin.py rename to tests_functional/django_pytest_pure/app/admin.py diff --git a/example/django_pytest_pure/app/apps.py b/tests_functional/django_pytest_pure/app/apps.py similarity index 100% rename from example/django_pytest_pure/app/apps.py rename to tests_functional/django_pytest_pure/app/apps.py diff --git a/example/django_pytest_pure/app/migrations/__init__.py b/tests_functional/django_pytest_pure/app/migrations/__init__.py similarity index 100% rename from example/django_pytest_pure/app/migrations/__init__.py rename to tests_functional/django_pytest_pure/app/migrations/__init__.py diff --git a/example/django_pytest_pure/app/models.py b/tests_functional/django_pytest_pure/app/models.py similarity index 100% rename from example/django_pytest_pure/app/models.py rename to tests_functional/django_pytest_pure/app/models.py diff --git a/example/django_pytest_pure/app/templates/hello.html b/tests_functional/django_pytest_pure/app/templates/hello.html similarity index 100% rename from example/django_pytest_pure/app/templates/hello.html rename to tests_functional/django_pytest_pure/app/templates/hello.html diff --git a/example/django_pytest_pure/app/tests/__init__.py b/tests_functional/django_pytest_pure/app/tests/__init__.py similarity index 100% rename from example/django_pytest_pure/app/tests/__init__.py rename to tests_functional/django_pytest_pure/app/tests/__init__.py diff --git a/example/django_pytest_pure/app/tests/conftest.py b/tests_functional/django_pytest_pure/app/tests/conftest.py similarity index 100% rename from example/django_pytest_pure/app/tests/conftest.py rename to tests_functional/django_pytest_pure/app/tests/conftest.py diff --git a/example/django_pytest_pure/app/tests/test_app.py b/tests_functional/django_pytest_pure/app/tests/test_app.py similarity index 100% rename from example/django_pytest_pure/app/tests/test_app.py rename to tests_functional/django_pytest_pure/app/tests/test_app.py diff --git a/example/django_pytest_pure/app/urls.py b/tests_functional/django_pytest_pure/app/urls.py similarity index 100% rename from example/django_pytest_pure/app/urls.py rename to tests_functional/django_pytest_pure/app/urls.py diff --git a/example/django_pytest_pure/app/views.py b/tests_functional/django_pytest_pure/app/views.py similarity index 100% rename from example/django_pytest_pure/app/views.py rename to tests_functional/django_pytest_pure/app/views.py diff --git a/example/django_pytest_pure/manage.py b/tests_functional/django_pytest_pure/manage.py similarity index 100% rename from example/django_pytest_pure/manage.py rename to tests_functional/django_pytest_pure/manage.py diff --git a/example/django_pytest_pure/project/__init__.py b/tests_functional/django_pytest_pure/project/__init__.py similarity index 100% rename from example/django_pytest_pure/project/__init__.py rename to tests_functional/django_pytest_pure/project/__init__.py diff --git a/example/django_pytest_pure/project/fixtures/admin.json b/tests_functional/django_pytest_pure/project/fixtures/admin.json similarity index 100% rename from example/django_pytest_pure/project/fixtures/admin.json rename to tests_functional/django_pytest_pure/project/fixtures/admin.json diff --git a/example/django_pytest_pure/project/settings.py b/tests_functional/django_pytest_pure/project/settings.py similarity index 100% rename from example/django_pytest_pure/project/settings.py rename to tests_functional/django_pytest_pure/project/settings.py diff --git a/example/django_pytest_pure/project/urls.py b/tests_functional/django_pytest_pure/project/urls.py similarity index 100% rename from example/django_pytest_pure/project/urls.py rename to tests_functional/django_pytest_pure/project/urls.py diff --git a/example/django_pytest_pure/project/wsgi.py b/tests_functional/django_pytest_pure/project/wsgi.py similarity index 100% rename from example/django_pytest_pure/project/wsgi.py rename to tests_functional/django_pytest_pure/project/wsgi.py diff --git a/example/django_pytest_pure/pytest.ini b/tests_functional/django_pytest_pure/pytest.ini similarity index 100% rename from example/django_pytest_pure/pytest.ini rename to tests_functional/django_pytest_pure/pytest.ini diff --git a/example/django_pytest_pure/requirements.txt b/tests_functional/django_pytest_pure/requirements.txt similarity index 100% rename from example/django_pytest_pure/requirements.txt rename to tests_functional/django_pytest_pure/requirements.txt diff --git a/example/django_pytest_pure/setup.sh b/tests_functional/django_pytest_pure/setup.sh similarity index 100% rename from example/django_pytest_pure/setup.sh rename to tests_functional/django_pytest_pure/setup.sh diff --git a/example/django_pytest_pure/tests.sh b/tests_functional/django_pytest_pure/tests.sh similarity index 100% rename from example/django_pytest_pure/tests.sh rename to tests_functional/django_pytest_pure/tests.sh diff --git a/example/dotenv_loaded_if_enabled/.env b/tests_functional/dotenv_loaded_if_enabled/.env similarity index 100% rename from example/dotenv_loaded_if_enabled/.env rename to tests_functional/dotenv_loaded_if_enabled/.env diff --git a/tests_functional/dotenv_loaded_if_enabled/Makefile b/tests_functional/dotenv_loaded_if_enabled/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/dotenv_loaded_if_enabled/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/dotenv_loaded_if_enabled/app.py b/tests_functional/dotenv_loaded_if_enabled/app.py similarity index 100% rename from example/dotenv_loaded_if_enabled/app.py rename to tests_functional/dotenv_loaded_if_enabled/app.py diff --git a/example/dotenv_loaded_if_enabled/settings.toml b/tests_functional/dotenv_loaded_if_enabled/settings.toml similarity index 100% rename from example/dotenv_loaded_if_enabled/settings.toml rename to tests_functional/dotenv_loaded_if_enabled/settings.toml diff --git a/example/dotenv_not_loaded_by_default/.env b/tests_functional/dotenv_not_loaded_by_default/.env similarity index 100% rename from example/dotenv_not_loaded_by_default/.env rename to tests_functional/dotenv_not_loaded_by_default/.env diff --git a/tests_functional/dotenv_not_loaded_by_default/Makefile b/tests_functional/dotenv_not_loaded_by_default/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/dotenv_not_loaded_by_default/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/dotenv_not_loaded_by_default/app.py b/tests_functional/dotenv_not_loaded_by_default/app.py similarity index 100% rename from example/dotenv_not_loaded_by_default/app.py rename to tests_functional/dotenv_not_loaded_by_default/app.py diff --git a/example/dotenv_not_loaded_by_default/settings.toml b/tests_functional/dotenv_not_loaded_by_default/settings.toml similarity index 100% rename from example/dotenv_not_loaded_by_default/settings.toml rename to tests_functional/dotenv_not_loaded_by_default/settings.toml diff --git a/tests_functional/dummy_flask_extension/Makefile b/tests_functional/dummy_flask_extension/Makefile new file mode 100644 index 000000000..c6eb77cea --- /dev/null +++ b/tests_functional/dummy_flask_extension/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + echo "This module exists to be imported from pytest tests" diff --git a/example/dummy_flask_extension/README.md b/tests_functional/dummy_flask_extension/README.md similarity index 100% rename from example/dummy_flask_extension/README.md rename to tests_functional/dummy_flask_extension/README.md diff --git a/example/dummy_flask_extension/__init__.py b/tests_functional/dummy_flask_extension/__init__.py similarity index 100% rename from example/dummy_flask_extension/__init__.py rename to tests_functional/dummy_flask_extension/__init__.py diff --git a/example/dummy_flask_extension/dummy.py b/tests_functional/dummy_flask_extension/dummy.py similarity index 100% rename from example/dummy_flask_extension/dummy.py rename to tests_functional/dummy_flask_extension/dummy.py diff --git a/example/dunder/.env b/tests_functional/dunder/.env similarity index 100% rename from example/dunder/.env rename to tests_functional/dunder/.env diff --git a/tests_functional/dunder/Makefile b/tests_functional/dunder/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/dunder/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/dunder/app.py b/tests_functional/dunder/app.py similarity index 100% rename from example/dunder/app.py rename to tests_functional/dunder/app.py diff --git a/example/dunder/other_settings.py b/tests_functional/dunder/other_settings.py similarity index 100% rename from example/dunder/other_settings.py rename to tests_functional/dunder/other_settings.py diff --git a/example/dunder/settings.py b/tests_functional/dunder/settings.py similarity index 100% rename from example/dunder/settings.py rename to tests_functional/dunder/settings.py diff --git a/example/dynaconf_merge/.env b/tests_functional/dynaconf_merge/.env similarity index 100% rename from example/dynaconf_merge/.env rename to tests_functional/dynaconf_merge/.env diff --git a/example/dynaconf_merge/.secrets.toml b/tests_functional/dynaconf_merge/.secrets.toml similarity index 100% rename from example/dynaconf_merge/.secrets.toml rename to tests_functional/dynaconf_merge/.secrets.toml diff --git a/tests_functional/dynaconf_merge/Makefile b/tests_functional/dynaconf_merge/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/dynaconf_merge/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/dynaconf_merge/app.py b/tests_functional/dynaconf_merge/app.py similarity index 100% rename from example/dynaconf_merge/app.py rename to tests_functional/dynaconf_merge/app.py diff --git a/example/dynaconf_merge/settings.toml b/tests_functional/dynaconf_merge/settings.toml similarity index 100% rename from example/dynaconf_merge/settings.toml rename to tests_functional/dynaconf_merge/settings.toml diff --git a/example/envless_mode/.env b/tests_functional/envless_mode/.env similarity index 100% rename from example/envless_mode/.env rename to tests_functional/envless_mode/.env diff --git a/tests_functional/envless_mode/Makefile b/tests_functional/envless_mode/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/envless_mode/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/envless_mode/__init__.py b/tests_functional/envless_mode/__init__.py similarity index 100% rename from example/envless_mode/__init__.py rename to tests_functional/envless_mode/__init__.py diff --git a/example/envless_mode/app.py b/tests_functional/envless_mode/app.py similarity index 100% rename from example/envless_mode/app.py rename to tests_functional/envless_mode/app.py diff --git a/example/envless_mode/settings.yaml b/tests_functional/envless_mode/settings.yaml similarity index 100% rename from example/envless_mode/settings.yaml rename to tests_functional/envless_mode/settings.yaml diff --git a/example/envs/.env b/tests_functional/envs/.env similarity index 100% rename from example/envs/.env rename to tests_functional/envs/.env diff --git a/tests_functional/envs/Makefile b/tests_functional/envs/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/envs/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/envs/app.py b/tests_functional/envs/app.py similarity index 100% rename from example/envs/app.py rename to tests_functional/envs/app.py diff --git a/example/envs/settings.toml b/tests_functional/envs/settings.toml similarity index 100% rename from example/envs/settings.toml rename to tests_functional/envs/settings.toml diff --git a/example/envvar_prefix/.env b/tests_functional/envvar_prefix/.env similarity index 100% rename from example/envvar_prefix/.env rename to tests_functional/envvar_prefix/.env diff --git a/tests_functional/envvar_prefix/Makefile b/tests_functional/envvar_prefix/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/envvar_prefix/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/envvar_prefix/app.py b/tests_functional/envvar_prefix/app.py similarity index 100% rename from example/envvar_prefix/app.py rename to tests_functional/envvar_prefix/app.py diff --git a/tests_functional/fastapi_with_ini/Makefile b/tests_functional/fastapi_with_ini/Makefile new file mode 100644 index 000000000..0ed0e9aa2 --- /dev/null +++ b/tests_functional/fastapi_with_ini/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + echo "This must be executed manually" diff --git a/example/fastapi_with_ini/app.py b/tests_functional/fastapi_with_ini/app.py similarity index 100% rename from example/fastapi_with_ini/app.py rename to tests_functional/fastapi_with_ini/app.py diff --git a/example/fastapi_with_ini/config.toml b/tests_functional/fastapi_with_ini/config.toml similarity index 100% rename from example/fastapi_with_ini/config.toml rename to tests_functional/fastapi_with_ini/config.toml diff --git a/example/flask_with_commentjson/.env b/tests_functional/flask_with_commentjson/.env similarity index 100% rename from example/flask_with_commentjson/.env rename to tests_functional/flask_with_commentjson/.env diff --git a/example/flask_with_commentjson/.secrets.json b/tests_functional/flask_with_commentjson/.secrets.json similarity index 100% rename from example/flask_with_commentjson/.secrets.json rename to tests_functional/flask_with_commentjson/.secrets.json diff --git a/tests_functional/flask_with_commentjson/Makefile b/tests_functional/flask_with_commentjson/Makefile new file mode 100644 index 000000000..c692deb05 --- /dev/null +++ b/tests_functional/flask_with_commentjson/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + flask routes | grep -c flask_with_commentjson || exit 1 diff --git a/example/flask_with_commentjson/app.py b/tests_functional/flask_with_commentjson/app.py similarity index 100% rename from example/flask_with_commentjson/app.py rename to tests_functional/flask_with_commentjson/app.py diff --git a/example/flask_with_commentjson/requirements.txt b/tests_functional/flask_with_commentjson/requirements.txt similarity index 100% rename from example/flask_with_commentjson/requirements.txt rename to tests_functional/flask_with_commentjson/requirements.txt diff --git a/example/flask_with_commentjson/settings.json b/tests_functional/flask_with_commentjson/settings.json similarity index 100% rename from example/flask_with_commentjson/settings.json rename to tests_functional/flask_with_commentjson/settings.json diff --git a/example/flask_with_commentjson/templates/dynaconf.html b/tests_functional/flask_with_commentjson/templates/dynaconf.html similarity index 100% rename from example/flask_with_commentjson/templates/dynaconf.html rename to tests_functional/flask_with_commentjson/templates/dynaconf.html diff --git a/example/flask_with_dotenv/.env b/tests_functional/flask_with_dotenv/.env similarity index 100% rename from example/flask_with_dotenv/.env rename to tests_functional/flask_with_dotenv/.env diff --git a/tests_functional/flask_with_dotenv/Makefile b/tests_functional/flask_with_dotenv/Makefile new file mode 100644 index 000000000..8a2337801 --- /dev/null +++ b/tests_functional/flask_with_dotenv/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + flask routes | grep -c flask_with_dotenv || exit 1 diff --git a/example/flask_with_dotenv/__init__.py b/tests_functional/flask_with_dotenv/__init__.py similarity index 100% rename from example/flask_with_dotenv/__init__.py rename to tests_functional/flask_with_dotenv/__init__.py diff --git a/example/flask_with_dotenv/app.py b/tests_functional/flask_with_dotenv/app.py similarity index 100% rename from example/flask_with_dotenv/app.py rename to tests_functional/flask_with_dotenv/app.py diff --git a/example/flask_with_dotenv/requirements.txt b/tests_functional/flask_with_dotenv/requirements.txt similarity index 100% rename from example/flask_with_dotenv/requirements.txt rename to tests_functional/flask_with_dotenv/requirements.txt diff --git a/example/flask_with_dotenv/templates/dynaconf.html b/tests_functional/flask_with_dotenv/templates/dynaconf.html similarity index 100% rename from example/flask_with_dotenv/templates/dynaconf.html rename to tests_functional/flask_with_dotenv/templates/dynaconf.html diff --git a/example/flask_with_ini/.env b/tests_functional/flask_with_ini/.env similarity index 100% rename from example/flask_with_ini/.env rename to tests_functional/flask_with_ini/.env diff --git a/example/flask_with_ini/.secrets.ini b/tests_functional/flask_with_ini/.secrets.ini similarity index 100% rename from example/flask_with_ini/.secrets.ini rename to tests_functional/flask_with_ini/.secrets.ini diff --git a/tests_functional/flask_with_ini/Makefile b/tests_functional/flask_with_ini/Makefile new file mode 100644 index 000000000..fbed3d837 --- /dev/null +++ b/tests_functional/flask_with_ini/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + flask routes | grep -c flask_with_ini || exit 1 diff --git a/example/flask_with_ini/app.py b/tests_functional/flask_with_ini/app.py similarity index 100% rename from example/flask_with_ini/app.py rename to tests_functional/flask_with_ini/app.py diff --git a/example/flask_with_ini/requirements.txt b/tests_functional/flask_with_ini/requirements.txt similarity index 100% rename from example/flask_with_ini/requirements.txt rename to tests_functional/flask_with_ini/requirements.txt diff --git a/example/flask_with_ini/settings.ini b/tests_functional/flask_with_ini/settings.ini similarity index 100% rename from example/flask_with_ini/settings.ini rename to tests_functional/flask_with_ini/settings.ini diff --git a/example/flask_with_ini/templates/dynaconf.html b/tests_functional/flask_with_ini/templates/dynaconf.html similarity index 100% rename from example/flask_with_ini/templates/dynaconf.html rename to tests_functional/flask_with_ini/templates/dynaconf.html diff --git a/example/flask_with_json/.env b/tests_functional/flask_with_json/.env similarity index 100% rename from example/flask_with_json/.env rename to tests_functional/flask_with_json/.env diff --git a/example/flask_with_json/.secrets.json b/tests_functional/flask_with_json/.secrets.json similarity index 100% rename from example/flask_with_json/.secrets.json rename to tests_functional/flask_with_json/.secrets.json diff --git a/tests_functional/flask_with_json/Makefile b/tests_functional/flask_with_json/Makefile new file mode 100644 index 000000000..8c01074ca --- /dev/null +++ b/tests_functional/flask_with_json/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + flask routes | grep -c flask_with_json || exit 1 diff --git a/example/flask_with_json/app.py b/tests_functional/flask_with_json/app.py similarity index 100% rename from example/flask_with_json/app.py rename to tests_functional/flask_with_json/app.py diff --git a/example/flask_with_json/requirements.txt b/tests_functional/flask_with_json/requirements.txt similarity index 100% rename from example/flask_with_json/requirements.txt rename to tests_functional/flask_with_json/requirements.txt diff --git a/example/flask_with_json/settings.json b/tests_functional/flask_with_json/settings.json similarity index 100% rename from example/flask_with_json/settings.json rename to tests_functional/flask_with_json/settings.json diff --git a/example/flask_with_json/templates/dynaconf.html b/tests_functional/flask_with_json/templates/dynaconf.html similarity index 100% rename from example/flask_with_json/templates/dynaconf.html rename to tests_functional/flask_with_json/templates/dynaconf.html diff --git a/example/flask_with_toml/.env b/tests_functional/flask_with_toml/.env similarity index 100% rename from example/flask_with_toml/.env rename to tests_functional/flask_with_toml/.env diff --git a/example/flask_with_toml/.secrets.toml b/tests_functional/flask_with_toml/.secrets.toml similarity index 100% rename from example/flask_with_toml/.secrets.toml rename to tests_functional/flask_with_toml/.secrets.toml diff --git a/tests_functional/flask_with_toml/Makefile b/tests_functional/flask_with_toml/Makefile new file mode 100644 index 000000000..6191c0a2c --- /dev/null +++ b/tests_functional/flask_with_toml/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + flask routes | grep -c flask_with_toml || exit 1 diff --git a/example/flask_with_toml/app.py b/tests_functional/flask_with_toml/app.py similarity index 100% rename from example/flask_with_toml/app.py rename to tests_functional/flask_with_toml/app.py diff --git a/example/flask_with_toml/requirements.txt b/tests_functional/flask_with_toml/requirements.txt similarity index 100% rename from example/flask_with_toml/requirements.txt rename to tests_functional/flask_with_toml/requirements.txt diff --git a/example/flask_with_toml/settings.toml b/tests_functional/flask_with_toml/settings.toml similarity index 100% rename from example/flask_with_toml/settings.toml rename to tests_functional/flask_with_toml/settings.toml diff --git a/example/flask_with_toml/templates/dynaconf.html b/tests_functional/flask_with_toml/templates/dynaconf.html similarity index 100% rename from example/flask_with_toml/templates/dynaconf.html rename to tests_functional/flask_with_toml/templates/dynaconf.html diff --git a/example/flask_with_yaml/.env b/tests_functional/flask_with_yaml/.env similarity index 100% rename from example/flask_with_yaml/.env rename to tests_functional/flask_with_yaml/.env diff --git a/example/flask_with_yaml/.secrets.yml b/tests_functional/flask_with_yaml/.secrets.yml similarity index 100% rename from example/flask_with_yaml/.secrets.yml rename to tests_functional/flask_with_yaml/.secrets.yml diff --git a/tests_functional/flask_with_yaml/Makefile b/tests_functional/flask_with_yaml/Makefile new file mode 100644 index 000000000..8ba290281 --- /dev/null +++ b/tests_functional/flask_with_yaml/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + flask routes | grep -c flask_with_yaml || exit 1 diff --git a/example/flask_with_yaml/app.py b/tests_functional/flask_with_yaml/app.py similarity index 100% rename from example/flask_with_yaml/app.py rename to tests_functional/flask_with_yaml/app.py diff --git a/example/flask_with_yaml/requirements.txt b/tests_functional/flask_with_yaml/requirements.txt similarity index 100% rename from example/flask_with_yaml/requirements.txt rename to tests_functional/flask_with_yaml/requirements.txt diff --git a/example/flask_with_yaml/settings.yml b/tests_functional/flask_with_yaml/settings.yml similarity index 100% rename from example/flask_with_yaml/settings.yml rename to tests_functional/flask_with_yaml/settings.yml diff --git a/example/flask_with_yaml/templates/dynaconf.html b/tests_functional/flask_with_yaml/templates/dynaconf.html similarity index 100% rename from example/flask_with_yaml/templates/dynaconf.html rename to tests_functional/flask_with_yaml/templates/dynaconf.html diff --git a/example/format/.env b/tests_functional/format/.env similarity index 100% rename from example/format/.env rename to tests_functional/format/.env diff --git a/tests_functional/format/Makefile b/tests_functional/format/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/format/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/format/app.py b/tests_functional/format/app.py similarity index 100% rename from example/format/app.py rename to tests_functional/format/app.py diff --git a/example/format/settings.toml b/tests_functional/format/settings.toml similarity index 100% rename from example/format/settings.toml rename to tests_functional/format/settings.toml diff --git a/example/full_example.py b/tests_functional/full_example/app.py similarity index 100% rename from example/full_example.py rename to tests_functional/full_example/app.py diff --git a/example/full_test/.env b/tests_functional/full_test/.env similarity index 100% rename from example/full_test/.env rename to tests_functional/full_test/.env diff --git a/tests_functional/full_test/Makefile b/tests_functional/full_test/Makefile new file mode 100644 index 000000000..72abe0849 --- /dev/null +++ b/tests_functional/full_test/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python test.py diff --git a/example/full_test/settings.ini b/tests_functional/full_test/settings.ini similarity index 100% rename from example/full_test/settings.ini rename to tests_functional/full_test/settings.ini diff --git a/example/full_test/settings.json b/tests_functional/full_test/settings.json similarity index 100% rename from example/full_test/settings.json rename to tests_functional/full_test/settings.json diff --git a/example/full_test/settings.py b/tests_functional/full_test/settings.py similarity index 100% rename from example/full_test/settings.py rename to tests_functional/full_test/settings.py diff --git a/example/full_test/settings.toml b/tests_functional/full_test/settings.toml similarity index 100% rename from example/full_test/settings.toml rename to tests_functional/full_test/settings.toml diff --git a/example/full_test/settings.yaml b/tests_functional/full_test/settings.yaml similarity index 100% rename from example/full_test/settings.yaml rename to tests_functional/full_test/settings.yaml diff --git a/example/full_test/staging_settings.py b/tests_functional/full_test/staging_settings.py similarity index 100% rename from example/full_test/staging_settings.py rename to tests_functional/full_test/staging_settings.py diff --git a/example/full_test/test.py b/tests_functional/full_test/test.py similarity index 93% rename from example/full_test/test.py rename to tests_functional/full_test/test.py index 1820c28f3..766b46ae5 100644 --- a/example/full_test/test.py +++ b/tests_functional/full_test/test.py @@ -1,11 +1,16 @@ from __future__ import annotations +import os + from dynaconf import settings + +HERE = os.path.dirname(os.path.abspath(__file__)) + # test default loader never gets cleaned EXPECTED = { - "ROOT_PATH_FOR_DYNACONF": ".", + "ROOT_PATH_FOR_DYNACONF": HERE, "ENV_FOR_DYNACONF": "DEVELOPMENT", "DEFAULT_ENV_FOR_DYNACONF": "DEFAULT", "ENVVAR_PREFIX_FOR_DYNACONF": "DYNACONF", @@ -22,10 +27,10 @@ "timeout": None, "proxies": None, "allow_redirects": None, - "session": None, + # "session": None, }, "VAULT_ENABLED_FOR_DYNACONF": False, - "VAULT_PATH_FOR_DYNACONF": "/secret/data/", + "VAULT_PATH_FOR_DYNACONF": "dynaconf", "CORE_LOADERS_FOR_DYNACONF": ["YAML", "TOML", "INI", "JSON", "PY"], "LOADERS_FOR_DYNACONF": ["dynaconf.loaders.env_loader"], "SILENT_ERRORS_FOR_DYNACONF": True, @@ -38,7 +43,7 @@ "DOTENV_VERBOSE_FOR_DYNACONF": False, "DOTENV_OVERRIDE_FOR_DYNACONF": False, "INSTANCE_FOR_DYNACONF": None, - "YAML_LOADER_FOR_DYNACONF": "full_load", + "YAML_LOADER_FOR_DYNACONF": "safe_load", "COMMENTJSON_ENABLED_FOR_DYNACONF": False, "SECRETS_FOR_DYNACONF": None, "INCLUDES_FOR_DYNACONF": [], @@ -51,7 +56,7 @@ for k, v in EXPECTED.items(): current = settings.get(k) - assert current == v, f"{k} is {current} expected {v}" + assert current == v, f"{k} is {current!r} expected {v!r}" print("store:", settings.store) print("loaders:", settings.loaded_by_loaders) diff --git a/example/get_fresh/.env b/tests_functional/get_fresh/.env similarity index 100% rename from example/get_fresh/.env rename to tests_functional/get_fresh/.env diff --git a/tests_functional/get_fresh/Makefile b/tests_functional/get_fresh/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/get_fresh/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/get_fresh/app.py b/tests_functional/get_fresh/app.py similarity index 100% rename from example/get_fresh/app.py rename to tests_functional/get_fresh/app.py diff --git a/example/get_fresh/settings.toml b/tests_functional/get_fresh/settings.toml similarity index 100% rename from example/get_fresh/settings.toml rename to tests_functional/get_fresh/settings.toml diff --git a/example/ignore_unknown_envvars/.env b/tests_functional/ignore_unknown_envvars/.env similarity index 100% rename from example/ignore_unknown_envvars/.env rename to tests_functional/ignore_unknown_envvars/.env diff --git a/tests_functional/ignore_unknown_envvars/Makefile b/tests_functional/ignore_unknown_envvars/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/ignore_unknown_envvars/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/ignore_unknown_envvars/app.py b/tests_functional/ignore_unknown_envvars/app.py similarity index 100% rename from example/ignore_unknown_envvars/app.py rename to tests_functional/ignore_unknown_envvars/app.py diff --git a/example/ignore_unknown_envvars/settings.toml b/tests_functional/ignore_unknown_envvars/settings.toml similarity index 100% rename from example/ignore_unknown_envvars/settings.toml rename to tests_functional/ignore_unknown_envvars/settings.toml diff --git a/example/includes/.env b/tests_functional/includes/.env similarity index 100% rename from example/includes/.env rename to tests_functional/includes/.env diff --git a/tests_functional/includes/Makefile b/tests_functional/includes/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/includes/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/includes/app.py b/tests_functional/includes/app.py similarity index 100% rename from example/includes/app.py rename to tests_functional/includes/app.py diff --git a/example/includes/configs/plugin1.toml b/tests_functional/includes/configs/plugin1.toml similarity index 100% rename from example/includes/configs/plugin1.toml rename to tests_functional/includes/configs/plugin1.toml diff --git a/example/includes/configs/plugin2.yaml b/tests_functional/includes/configs/plugin2.yaml similarity index 100% rename from example/includes/configs/plugin2.yaml rename to tests_functional/includes/configs/plugin2.yaml diff --git a/example/includes/configs/plugin3.json b/tests_functional/includes/configs/plugin3.json similarity index 100% rename from example/includes/configs/plugin3.json rename to tests_functional/includes/configs/plugin3.json diff --git a/example/includes/configs/plugin4.py b/tests_functional/includes/configs/plugin4.py similarity index 100% rename from example/includes/configs/plugin4.py rename to tests_functional/includes/configs/plugin4.py diff --git a/example/includes/settings.toml b/tests_functional/includes/settings.toml similarity index 100% rename from example/includes/settings.toml rename to tests_functional/includes/settings.toml diff --git a/example/includes/this_is_not_loaded.toml b/tests_functional/includes/this_is_not_loaded.toml similarity index 100% rename from example/includes/this_is_not_loaded.toml rename to tests_functional/includes/this_is_not_loaded.toml diff --git a/example/issues/160_path_traversal_fixed/.env b/tests_functional/issues/160_path_traversal_fixed/.env similarity index 100% rename from example/issues/160_path_traversal_fixed/.env rename to tests_functional/issues/160_path_traversal_fixed/.env diff --git a/example/issues/160_path_traversal_fixed/subfolder/.keep b/tests_functional/issues/160_path_traversal_fixed/subfolder/.keep similarity index 100% rename from example/issues/160_path_traversal_fixed/subfolder/.keep rename to tests_functional/issues/160_path_traversal_fixed/subfolder/.keep diff --git a/example/issues/160_path_traversal_fixed/test.sh b/tests_functional/issues/160_path_traversal_fixed/test.sh similarity index 100% rename from example/issues/160_path_traversal_fixed/test.sh rename to tests_functional/issues/160_path_traversal_fixed/test.sh diff --git a/example/issues/166_renamed_global_env/.env b/tests_functional/issues/166_renamed_global_env/.env similarity index 100% rename from example/issues/166_renamed_global_env/.env rename to tests_functional/issues/166_renamed_global_env/.env diff --git a/example/issues/166_renamed_global_env/app.py b/tests_functional/issues/166_renamed_global_env/app.py similarity index 100% rename from example/issues/166_renamed_global_env/app.py rename to tests_functional/issues/166_renamed_global_env/app.py diff --git a/example/issues/169_renamed_settings_module/.env b/tests_functional/issues/169_renamed_settings_module/.env similarity index 100% rename from example/issues/169_renamed_settings_module/.env rename to tests_functional/issues/169_renamed_settings_module/.env diff --git a/example/issues/169_renamed_settings_module/app.py b/tests_functional/issues/169_renamed_settings_module/app.py similarity index 100% rename from example/issues/169_renamed_settings_module/app.py rename to tests_functional/issues/169_renamed_settings_module/app.py diff --git a/example/issues/169_renamed_settings_module/foo_bar.toml b/tests_functional/issues/169_renamed_settings_module/foo_bar.toml similarity index 100% rename from example/issues/169_renamed_settings_module/foo_bar.toml rename to tests_functional/issues/169_renamed_settings_module/foo_bar.toml diff --git a/example/issues/182_multiple_locations/.env b/tests_functional/issues/182_multiple_locations/.env similarity index 100% rename from example/issues/182_multiple_locations/.env rename to tests_functional/issues/182_multiple_locations/.env diff --git a/example/issues/182_multiple_locations/app.py b/tests_functional/issues/182_multiple_locations/app.py similarity index 100% rename from example/issues/182_multiple_locations/app.py rename to tests_functional/issues/182_multiple_locations/app.py diff --git a/example/issues/182_multiple_locations/cfg/settings.toml b/tests_functional/issues/182_multiple_locations/cfg/settings.toml similarity index 100% rename from example/issues/182_multiple_locations/cfg/settings.toml rename to tests_functional/issues/182_multiple_locations/cfg/settings.toml diff --git a/example/issues/182_multiple_locations/cfg2/settings.toml b/tests_functional/issues/182_multiple_locations/cfg2/settings.toml similarity index 100% rename from example/issues/182_multiple_locations/cfg2/settings.toml rename to tests_functional/issues/182_multiple_locations/cfg2/settings.toml diff --git a/example/issues/182_multiple_locations/default.toml b/tests_functional/issues/182_multiple_locations/default.toml similarity index 100% rename from example/issues/182_multiple_locations/default.toml rename to tests_functional/issues/182_multiple_locations/default.toml diff --git a/example/issues/184_ipython/.env b/tests_functional/issues/184_ipython/.env similarity index 100% rename from example/issues/184_ipython/.env rename to tests_functional/issues/184_ipython/.env diff --git a/example/issues/184_ipython/app.py b/tests_functional/issues/184_ipython/app.py similarity index 100% rename from example/issues/184_ipython/app.py rename to tests_functional/issues/184_ipython/app.py diff --git a/example/issues/184_ipython/subdir/app.py b/tests_functional/issues/184_ipython/subdir/app.py similarity index 100% rename from example/issues/184_ipython/subdir/app.py rename to tests_functional/issues/184_ipython/subdir/app.py diff --git a/example/issues/184_ipython/test.sh b/tests_functional/issues/184_ipython/test.sh similarity index 100% rename from example/issues/184_ipython/test.sh rename to tests_functional/issues/184_ipython/test.sh diff --git a/example/issues/194_flask_config/app.py b/tests_functional/issues/194_flask_config/app.py similarity index 100% rename from example/issues/194_flask_config/app.py rename to tests_functional/issues/194_flask_config/app.py diff --git a/example/issues/228_nested_toml_bool/django_app/django_app/__init__.py b/tests_functional/issues/228_django_app/django_app/__init__.py similarity index 100% rename from example/issues/228_nested_toml_bool/django_app/django_app/__init__.py rename to tests_functional/issues/228_django_app/django_app/__init__.py diff --git a/example/issues/228_nested_toml_bool/django_app/django_app/settings.py b/tests_functional/issues/228_django_app/django_app/settings.py similarity index 100% rename from example/issues/228_nested_toml_bool/django_app/django_app/settings.py rename to tests_functional/issues/228_django_app/django_app/settings.py diff --git a/example/issues/228_nested_toml_bool/django_app/django_app/urls.py b/tests_functional/issues/228_django_app/django_app/urls.py similarity index 100% rename from example/issues/228_nested_toml_bool/django_app/django_app/urls.py rename to tests_functional/issues/228_django_app/django_app/urls.py diff --git a/example/issues/228_nested_toml_bool/django_app/django_app/wsgi.py b/tests_functional/issues/228_django_app/django_app/wsgi.py similarity index 100% rename from example/issues/228_nested_toml_bool/django_app/django_app/wsgi.py rename to tests_functional/issues/228_django_app/django_app/wsgi.py diff --git a/example/issues/228_nested_toml_bool/django_app/manage.py b/tests_functional/issues/228_django_app/manage.py similarity index 100% rename from example/issues/228_nested_toml_bool/django_app/manage.py rename to tests_functional/issues/228_django_app/manage.py diff --git a/example/issues/228_nested_toml_bool/django_app/settings.toml b/tests_functional/issues/228_django_app/settings.toml similarity index 100% rename from example/issues/228_nested_toml_bool/django_app/settings.toml rename to tests_functional/issues/228_django_app/settings.toml diff --git a/example/issues/228_nested_toml_bool/python_app/app.py b/tests_functional/issues/228_python_app/app.py similarity index 100% rename from example/issues/228_nested_toml_bool/python_app/app.py rename to tests_functional/issues/228_python_app/app.py diff --git a/example/issues/228_nested_toml_bool/python_app/settings.toml b/tests_functional/issues/228_python_app/settings.toml similarity index 100% rename from example/issues/228_nested_toml_bool/python_app/settings.toml rename to tests_functional/issues/228_python_app/settings.toml diff --git a/example/issues/251_dotted_unexistent/.env b/tests_functional/issues/251_dotted_unexistent/.env similarity index 100% rename from example/issues/251_dotted_unexistent/.env rename to tests_functional/issues/251_dotted_unexistent/.env diff --git a/example/issues/251_dotted_unexistent/app.py b/tests_functional/issues/251_dotted_unexistent/app.py similarity index 100% rename from example/issues/251_dotted_unexistent/app.py rename to tests_functional/issues/251_dotted_unexistent/app.py diff --git a/example/issues/251_dotted_unexistent/settings.py b/tests_functional/issues/251_dotted_unexistent/settings.py similarity index 100% rename from example/issues/251_dotted_unexistent/settings.py rename to tests_functional/issues/251_dotted_unexistent/settings.py diff --git a/example/issues/253_set/app.py b/tests_functional/issues/253_set/app.py similarity index 100% rename from example/issues/253_set/app.py rename to tests_functional/issues/253_set/app.py diff --git a/example/issues/266_envvar_from_env_override/.env b/tests_functional/issues/266_envvar_from_env_override/.env similarity index 100% rename from example/issues/266_envvar_from_env_override/.env rename to tests_functional/issues/266_envvar_from_env_override/.env diff --git a/example/issues/266_envvar_from_env_override/app.py b/tests_functional/issues/266_envvar_from_env_override/app.py similarity index 100% rename from example/issues/266_envvar_from_env_override/app.py rename to tests_functional/issues/266_envvar_from_env_override/app.py diff --git a/example/issues/266_envvar_from_env_override/settings.toml b/tests_functional/issues/266_envvar_from_env_override/settings.toml similarity index 100% rename from example/issues/266_envvar_from_env_override/settings.toml rename to tests_functional/issues/266_envvar_from_env_override/settings.toml diff --git a/example/issues/284_local_sets/app.py b/tests_functional/issues/284_local_sets/app.py similarity index 100% rename from example/issues/284_local_sets/app.py rename to tests_functional/issues/284_local_sets/app.py diff --git a/example/issues/284_local_sets/settings.local.toml b/tests_functional/issues/284_local_sets/settings.local.toml similarity index 100% rename from example/issues/284_local_sets/settings.local.toml rename to tests_functional/issues/284_local_sets/settings.local.toml diff --git a/example/issues/284_local_sets/settings.toml b/tests_functional/issues/284_local_sets/settings.toml similarity index 100% rename from example/issues/284_local_sets/settings.toml rename to tests_functional/issues/284_local_sets/settings.toml diff --git a/example/issues/288_null_values/.env b/tests_functional/issues/288_null_values/.env similarity index 100% rename from example/issues/288_null_values/.env rename to tests_functional/issues/288_null_values/.env diff --git a/example/issues/288_null_values/app.py b/tests_functional/issues/288_null_values/app.py similarity index 100% rename from example/issues/288_null_values/app.py rename to tests_functional/issues/288_null_values/app.py diff --git a/example/issues/288_null_values/settings.json b/tests_functional/issues/288_null_values/settings.json similarity index 100% rename from example/issues/288_null_values/settings.json rename to tests_functional/issues/288_null_values/settings.json diff --git a/example/issues/288_null_values/settings.py b/tests_functional/issues/288_null_values/settings.py similarity index 100% rename from example/issues/288_null_values/settings.py rename to tests_functional/issues/288_null_values/settings.py diff --git a/example/issues/288_null_values/settings.toml b/tests_functional/issues/288_null_values/settings.toml similarity index 100% rename from example/issues/288_null_values/settings.toml rename to tests_functional/issues/288_null_values/settings.toml diff --git a/example/issues/288_null_values/settings.yaml b/tests_functional/issues/288_null_values/settings.yaml similarity index 100% rename from example/issues/288_null_values/settings.yaml rename to tests_functional/issues/288_null_values/settings.yaml diff --git a/example/issues/306_merge_replace/.env b/tests_functional/issues/306_merge_replace/.env similarity index 100% rename from example/issues/306_merge_replace/.env rename to tests_functional/issues/306_merge_replace/.env diff --git a/example/issues/306_merge_replace/app.py b/tests_functional/issues/306_merge_replace/app.py similarity index 100% rename from example/issues/306_merge_replace/app.py rename to tests_functional/issues/306_merge_replace/app.py diff --git a/example/issues/306_merge_replace/development_settings.py b/tests_functional/issues/306_merge_replace/development_settings.py similarity index 100% rename from example/issues/306_merge_replace/development_settings.py rename to tests_functional/issues/306_merge_replace/development_settings.py diff --git a/example/issues/306_merge_replace/settings.py b/tests_functional/issues/306_merge_replace/settings.py similarity index 100% rename from example/issues/306_merge_replace/settings.py rename to tests_functional/issues/306_merge_replace/settings.py diff --git a/example/issues/323_DEFAULT_VALUES_RESOLUTION/app.py b/tests_functional/issues/323_DEFAULT_VALUES_RESOLUTION/app.py similarity index 100% rename from example/issues/323_DEFAULT_VALUES_RESOLUTION/app.py rename to tests_functional/issues/323_DEFAULT_VALUES_RESOLUTION/app.py diff --git a/example/issues/323_DEFAULT_VALUES_RESOLUTION/settings.toml b/tests_functional/issues/323_DEFAULT_VALUES_RESOLUTION/settings.toml similarity index 100% rename from example/issues/323_DEFAULT_VALUES_RESOLUTION/settings.toml rename to tests_functional/issues/323_DEFAULT_VALUES_RESOLUTION/settings.toml diff --git a/example/issues/325_flask_dot_env/.env b/tests_functional/issues/325_flask_dot_env/.env similarity index 100% rename from example/issues/325_flask_dot_env/.env rename to tests_functional/issues/325_flask_dot_env/.env diff --git a/example/issues/325_flask_dot_env/app.py b/tests_functional/issues/325_flask_dot_env/app.py similarity index 100% rename from example/issues/325_flask_dot_env/app.py rename to tests_functional/issues/325_flask_dot_env/app.py diff --git a/example/issues/325_flask_dot_env/settings.toml b/tests_functional/issues/325_flask_dot_env/settings.toml similarity index 100% rename from example/issues/325_flask_dot_env/settings.toml rename to tests_functional/issues/325_flask_dot_env/settings.toml diff --git a/example/issues/327_flask_extensions_warning/app.py b/tests_functional/issues/327_flask_extensions_warning/app.py similarity index 100% rename from example/issues/327_flask_extensions_warning/app.py rename to tests_functional/issues/327_flask_extensions_warning/app.py diff --git a/example/issues/327_flask_extensions_warning/settings.toml b/tests_functional/issues/327_flask_extensions_warning/settings.toml similarity index 100% rename from example/issues/327_flask_extensions_warning/settings.toml rename to tests_functional/issues/327_flask_extensions_warning/settings.toml diff --git a/example/issues/341_box_it_up/app.py b/tests_functional/issues/341_box_it_up/app.py similarity index 100% rename from example/issues/341_box_it_up/app.py rename to tests_functional/issues/341_box_it_up/app.py diff --git a/example/issues/341_box_it_up/settings.yaml b/tests_functional/issues/341_box_it_up/settings.yaml similarity index 100% rename from example/issues/341_box_it_up/settings.yaml rename to tests_functional/issues/341_box_it_up/settings.yaml diff --git a/example/issues/359_variable_reference/app.py b/tests_functional/issues/359_variable_reference/app.py similarity index 100% rename from example/issues/359_variable_reference/app.py rename to tests_functional/issues/359_variable_reference/app.py diff --git a/example/issues/359_variable_reference/settings.yaml b/tests_functional/issues/359_variable_reference/settings.yaml similarity index 100% rename from example/issues/359_variable_reference/settings.yaml rename to tests_functional/issues/359_variable_reference/settings.yaml diff --git a/example/issues/377_default_validators/app.py b/tests_functional/issues/377_default_validators/app.py similarity index 100% rename from example/issues/377_default_validators/app.py rename to tests_functional/issues/377_default_validators/app.py diff --git a/example/issues/377_default_validators/settings.toml b/tests_functional/issues/377_default_validators/settings.toml similarity index 100% rename from example/issues/377_default_validators/settings.toml rename to tests_functional/issues/377_default_validators/settings.toml diff --git a/example/issues/379_dict_like_iteration/app.py b/tests_functional/issues/379_dict_like_iteration/app.py similarity index 100% rename from example/issues/379_dict_like_iteration/app.py rename to tests_functional/issues/379_dict_like_iteration/app.py diff --git a/example/issues/379_dict_like_iteration/settings.toml b/tests_functional/issues/379_dict_like_iteration/settings.toml similarity index 88% rename from example/issues/379_dict_like_iteration/settings.toml rename to tests_functional/issues/379_dict_like_iteration/settings.toml index a5aaff239..93e8335af 100644 --- a/example/issues/379_dict_like_iteration/settings.toml +++ b/tests_functional/issues/379_dict_like_iteration/settings.toml @@ -3,7 +3,9 @@ a_boolean = false number = 789 # had to edit this to match assertion above; previous value: 1234 a_float = 56.8 a_list = [1, 2, 3, 4] -a_dict = {hello="world"} + +[a_dict] +hello="world" [a_dict.nested] other_level = "nested value" diff --git a/example/issues/384_dotted_set/README.md b/tests_functional/issues/384_dotted_set/README.md similarity index 100% rename from example/issues/384_dotted_set/README.md rename to tests_functional/issues/384_dotted_set/README.md diff --git a/example/issues/384_dotted_set/app.py b/tests_functional/issues/384_dotted_set/app.py similarity index 100% rename from example/issues/384_dotted_set/app.py rename to tests_functional/issues/384_dotted_set/app.py diff --git a/tests_functional/issues/392_evaluate_nested_structures/.env b/tests_functional/issues/392_evaluate_nested_structures/.env new file mode 100644 index 000000000..32c4098ae --- /dev/null +++ b/tests_functional/issues/392_evaluate_nested_structures/.env @@ -0,0 +1 @@ +DYNACONF_INITIAL='@merge [1,2,3]' diff --git a/example/issues/392_evaluate_nested_structures/app.py b/tests_functional/issues/392_evaluate_nested_structures/app.py similarity index 65% rename from example/issues/392_evaluate_nested_structures/app.py rename to tests_functional/issues/392_evaluate_nested_structures/app.py index a7cbe7854..497ebf458 100644 --- a/example/issues/392_evaluate_nested_structures/app.py +++ b/tests_functional/issues/392_evaluate_nested_structures/app.py @@ -3,7 +3,9 @@ from dynaconf import Dynaconf settings = Dynaconf( - settings_files=["settings.toml", "settings.yaml"], environments=True + settings_files=["settings.toml", "settings.yaml"], + environments=True, + load_dotenv=True, ) assert settings.SOME_DICT.value == "formatted: foo", settings.SOME_DICT.value @@ -21,4 +23,7 @@ settings.set("INITIAL", "@merge [9, 8, 7]") -settings.set("DATABASES.default.PARAMS", '@merge ["e", "f", "g"]') +settings.set("DATABASES.default.PARAMS", '@merge_unique ["e", "f", "g"]') + +assert settings.DATABASES == {"default": {"PARAMS": ["d", "e", "f", "g"]}} +assert settings.INITIAL == [3, 2, 2, 1, 1, 1, 2, 3, 9, 8, 7], settings.INITIAL diff --git a/example/issues/392_evaluate_nested_structures/issue.md b/tests_functional/issues/392_evaluate_nested_structures/issue.md similarity index 100% rename from example/issues/392_evaluate_nested_structures/issue.md rename to tests_functional/issues/392_evaluate_nested_structures/issue.md diff --git a/example/issues/392_evaluate_nested_structures/settings.toml b/tests_functional/issues/392_evaluate_nested_structures/settings.toml similarity index 100% rename from example/issues/392_evaluate_nested_structures/settings.toml rename to tests_functional/issues/392_evaluate_nested_structures/settings.toml diff --git a/example/issues/392_evaluate_nested_structures/settings.yaml b/tests_functional/issues/392_evaluate_nested_structures/settings.yaml similarity index 100% rename from example/issues/392_evaluate_nested_structures/settings.yaml rename to tests_functional/issues/392_evaluate_nested_structures/settings.yaml diff --git a/example/issues/404_dup_validator_message/app.py b/tests_functional/issues/404_dup_validator_message/app.py similarity index 100% rename from example/issues/404_dup_validator_message/app.py rename to tests_functional/issues/404_dup_validator_message/app.py diff --git a/example/issues/430_same_name/app.py b/tests_functional/issues/430_same_name/app.py similarity index 100% rename from example/issues/430_same_name/app.py rename to tests_functional/issues/430_same_name/app.py diff --git a/example/issues/430_same_name/folder/settings.yaml b/tests_functional/issues/430_same_name/folder/settings.yaml similarity index 100% rename from example/issues/430_same_name/folder/settings.yaml rename to tests_functional/issues/430_same_name/folder/settings.yaml diff --git a/example/issues/430_same_name/settings.yaml b/tests_functional/issues/430_same_name/settings.yaml similarity index 100% rename from example/issues/430_same_name/settings.yaml rename to tests_functional/issues/430_same_name/settings.yaml diff --git a/tests_functional/issues/434_setenv/Makefile b/tests_functional/issues/434_setenv/Makefile new file mode 100644 index 000000000..3d07edf77 --- /dev/null +++ b/tests_functional/issues/434_setenv/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py --config development dynaconf diff --git a/example/issues/434_setenv/app.py b/tests_functional/issues/434_setenv/app.py similarity index 100% rename from example/issues/434_setenv/app.py rename to tests_functional/issues/434_setenv/app.py diff --git a/example/issues/434_setenv/config.py b/tests_functional/issues/434_setenv/config.py similarity index 100% rename from example/issues/434_setenv/config.py rename to tests_functional/issues/434_setenv/config.py diff --git a/example/issues/434_setenv/settings.toml b/tests_functional/issues/434_setenv/settings.toml similarity index 100% rename from example/issues/434_setenv/settings.toml rename to tests_functional/issues/434_setenv/settings.toml diff --git a/example/issues/443_object_merge/README.md b/tests_functional/issues/443_object_merge/README.md similarity index 100% rename from example/issues/443_object_merge/README.md rename to tests_functional/issues/443_object_merge/README.md diff --git a/example/issues/443_object_merge/app.py b/tests_functional/issues/443_object_merge/app.py similarity index 100% rename from example/issues/443_object_merge/app.py rename to tests_functional/issues/443_object_merge/app.py diff --git a/example/issues/445_casting/.env b/tests_functional/issues/445_casting/.env similarity index 100% rename from example/issues/445_casting/.env rename to tests_functional/issues/445_casting/.env diff --git a/example/issues/445_casting/README.md b/tests_functional/issues/445_casting/README.md similarity index 100% rename from example/issues/445_casting/README.md rename to tests_functional/issues/445_casting/README.md diff --git a/example/issues/445_casting/app.py b/tests_functional/issues/445_casting/app.py similarity index 100% rename from example/issues/445_casting/app.py rename to tests_functional/issues/445_casting/app.py diff --git a/example/issues/449_django_lazy_path/.env b/tests_functional/issues/449_django_lazy_path/.env similarity index 100% rename from example/issues/449_django_lazy_path/.env rename to tests_functional/issues/449_django_lazy_path/.env diff --git a/example/issues/449_django_lazy_path/.secrets.yaml b/tests_functional/issues/449_django_lazy_path/.secrets.yaml similarity index 100% rename from example/issues/449_django_lazy_path/.secrets.yaml rename to tests_functional/issues/449_django_lazy_path/.secrets.yaml diff --git a/tests_functional/issues/449_django_lazy_path/Makefile b/tests_functional/issues/449_django_lazy_path/Makefile new file mode 100644 index 000000000..7278de86b --- /dev/null +++ b/tests_functional/issues/449_django_lazy_path/Makefile @@ -0,0 +1,8 @@ +.PHONY: test + +test: + python manage.py test polls -v 2 + PYTHONPATH=. DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 + cd ../../;python issues/449_django_lazy_path/manage.py test polls -v 2 + cd ../../../;PYTHONPATH=tests_functional/issues/449_django_lazy_path/ DJANGO_SETTINGS_MODULE=foo.settings django-admin test polls -v 2 + PYTHONPATH=. DJANGO_SETTINGS_MODULE=foo.settings python standalone_script.py diff --git a/example/issues/449_django_lazy_path/foo/__init__.py b/tests_functional/issues/449_django_lazy_path/foo/__init__.py similarity index 100% rename from example/issues/449_django_lazy_path/foo/__init__.py rename to tests_functional/issues/449_django_lazy_path/foo/__init__.py diff --git a/example/issues/449_django_lazy_path/foo/settings.py b/tests_functional/issues/449_django_lazy_path/foo/settings.py similarity index 100% rename from example/issues/449_django_lazy_path/foo/settings.py rename to tests_functional/issues/449_django_lazy_path/foo/settings.py diff --git a/example/issues/449_django_lazy_path/foo/urls.py b/tests_functional/issues/449_django_lazy_path/foo/urls.py similarity index 100% rename from example/issues/449_django_lazy_path/foo/urls.py rename to tests_functional/issues/449_django_lazy_path/foo/urls.py diff --git a/example/issues/449_django_lazy_path/foo/wsgi.py b/tests_functional/issues/449_django_lazy_path/foo/wsgi.py similarity index 100% rename from example/issues/449_django_lazy_path/foo/wsgi.py rename to tests_functional/issues/449_django_lazy_path/foo/wsgi.py diff --git a/example/issues/449_django_lazy_path/manage.py b/tests_functional/issues/449_django_lazy_path/manage.py similarity index 100% rename from example/issues/449_django_lazy_path/manage.py rename to tests_functional/issues/449_django_lazy_path/manage.py diff --git a/example/issues/449_django_lazy_path/polls/__init__.py b/tests_functional/issues/449_django_lazy_path/polls/__init__.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/__init__.py rename to tests_functional/issues/449_django_lazy_path/polls/__init__.py diff --git a/example/issues/449_django_lazy_path/polls/admin.py b/tests_functional/issues/449_django_lazy_path/polls/admin.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/admin.py rename to tests_functional/issues/449_django_lazy_path/polls/admin.py diff --git a/example/issues/449_django_lazy_path/polls/apps.py b/tests_functional/issues/449_django_lazy_path/polls/apps.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/apps.py rename to tests_functional/issues/449_django_lazy_path/polls/apps.py diff --git a/example/issues/449_django_lazy_path/polls/migrations/__init__.py b/tests_functional/issues/449_django_lazy_path/polls/migrations/__init__.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/migrations/__init__.py rename to tests_functional/issues/449_django_lazy_path/polls/migrations/__init__.py diff --git a/example/issues/449_django_lazy_path/polls/models.py b/tests_functional/issues/449_django_lazy_path/polls/models.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/models.py rename to tests_functional/issues/449_django_lazy_path/polls/models.py diff --git a/example/issues/449_django_lazy_path/polls/tests.py b/tests_functional/issues/449_django_lazy_path/polls/tests.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/tests.py rename to tests_functional/issues/449_django_lazy_path/polls/tests.py diff --git a/example/issues/449_django_lazy_path/polls/urls.py b/tests_functional/issues/449_django_lazy_path/polls/urls.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/urls.py rename to tests_functional/issues/449_django_lazy_path/polls/urls.py diff --git a/example/issues/449_django_lazy_path/polls/views.py b/tests_functional/issues/449_django_lazy_path/polls/views.py similarity index 100% rename from example/issues/449_django_lazy_path/polls/views.py rename to tests_functional/issues/449_django_lazy_path/polls/views.py diff --git a/example/issues/449_django_lazy_path/pulpsettings.py b/tests_functional/issues/449_django_lazy_path/pulpsettings.py similarity index 100% rename from example/issues/449_django_lazy_path/pulpsettings.py rename to tests_functional/issues/449_django_lazy_path/pulpsettings.py diff --git a/example/issues/449_django_lazy_path/settings.yaml b/tests_functional/issues/449_django_lazy_path/settings.yaml similarity index 100% rename from example/issues/449_django_lazy_path/settings.yaml rename to tests_functional/issues/449_django_lazy_path/settings.yaml diff --git a/example/issues/449_django_lazy_path/standalone_script.py b/tests_functional/issues/449_django_lazy_path/standalone_script.py similarity index 100% rename from example/issues/449_django_lazy_path/standalone_script.py rename to tests_functional/issues/449_django_lazy_path/standalone_script.py diff --git a/tests_functional/issues/467_load_from_parent_folder/Makefile b/tests_functional/issues/467_load_from_parent_folder/Makefile new file mode 100644 index 000000000..e7c2b4268 --- /dev/null +++ b/tests_functional/issues/467_load_from_parent_folder/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + cd src;pwd;python app.py diff --git a/example/issues/467_load_from_parent_folder/configs/config1.yaml b/tests_functional/issues/467_load_from_parent_folder/configs/config1.yaml similarity index 100% rename from example/issues/467_load_from_parent_folder/configs/config1.yaml rename to tests_functional/issues/467_load_from_parent_folder/configs/config1.yaml diff --git a/example/issues/467_load_from_parent_folder/configs/config2.yaml b/tests_functional/issues/467_load_from_parent_folder/configs/config2.yaml similarity index 100% rename from example/issues/467_load_from_parent_folder/configs/config2.yaml rename to tests_functional/issues/467_load_from_parent_folder/configs/config2.yaml diff --git a/example/issues/467_load_from_parent_folder/settings.toml b/tests_functional/issues/467_load_from_parent_folder/settings.toml similarity index 100% rename from example/issues/467_load_from_parent_folder/settings.toml rename to tests_functional/issues/467_load_from_parent_folder/settings.toml diff --git a/example/issues/467_load_from_parent_folder/src/app.py b/tests_functional/issues/467_load_from_parent_folder/src/app.py similarity index 100% rename from example/issues/467_load_from_parent_folder/src/app.py rename to tests_functional/issues/467_load_from_parent_folder/src/app.py diff --git a/example/issues/478_mispell_environments/app.py b/tests_functional/issues/478_mispell_environments/app.py similarity index 100% rename from example/issues/478_mispell_environments/app.py rename to tests_functional/issues/478_mispell_environments/app.py diff --git a/example/issues/478_mispell_environments/settings.toml b/tests_functional/issues/478_mispell_environments/settings.toml similarity index 100% rename from example/issues/478_mispell_environments/settings.toml rename to tests_functional/issues/478_mispell_environments/settings.toml diff --git a/example/issues/482_layered_format/app.py b/tests_functional/issues/482_layered_format/app.py similarity index 100% rename from example/issues/482_layered_format/app.py rename to tests_functional/issues/482_layered_format/app.py diff --git a/example/issues/482_layered_format/other.toml b/tests_functional/issues/482_layered_format/other.toml similarity index 100% rename from example/issues/482_layered_format/other.toml rename to tests_functional/issues/482_layered_format/other.toml diff --git a/example/issues/482_layered_format/settings.toml b/tests_functional/issues/482_layered_format/settings.toml similarity index 100% rename from example/issues/482_layered_format/settings.toml rename to tests_functional/issues/482_layered_format/settings.toml diff --git a/example/issues/486_title_case_validation/app.py b/tests_functional/issues/486_title_case_validation/app.py similarity index 100% rename from example/issues/486_title_case_validation/app.py rename to tests_functional/issues/486_title_case_validation/app.py diff --git a/example/issues/486_title_case_validation/settings.yaml b/tests_functional/issues/486_title_case_validation/settings.yaml similarity index 100% rename from example/issues/486_title_case_validation/settings.yaml rename to tests_functional/issues/486_title_case_validation/settings.yaml diff --git a/example/issues/494_using_pathlib/app.py b/tests_functional/issues/494_using_pathlib/app.py similarity index 100% rename from example/issues/494_using_pathlib/app.py rename to tests_functional/issues/494_using_pathlib/app.py diff --git a/example/issues/494_using_pathlib/folder/new.yaml b/tests_functional/issues/494_using_pathlib/folder/new.yaml similarity index 100% rename from example/issues/494_using_pathlib/folder/new.yaml rename to tests_functional/issues/494_using_pathlib/folder/new.yaml diff --git a/example/issues/494_using_pathlib/folder/settings.yaml b/tests_functional/issues/494_using_pathlib/folder/settings.yaml similarity index 100% rename from example/issues/494_using_pathlib/folder/settings.yaml rename to tests_functional/issues/494_using_pathlib/folder/settings.yaml diff --git a/tests_functional/issues/519_underscore_in_name/Makefile b/tests_functional/issues/519_underscore_in_name/Makefile new file mode 100644 index 000000000..9d8548896 --- /dev/null +++ b/tests_functional/issues/519_underscore_in_name/Makefile @@ -0,0 +1,6 @@ +.PHONY: test + +test: + ATC_BLE__device_id=42 EXPECTED_VALUE=42 python app.py + ATC_BLE__DEVICE_ID=42 EXPECTED_VALUE=42 python app.py + ATC_BLE__DEVice_Id=42 EXPECTED_VALUE=42 python app.py diff --git a/example/issues/519_underscore_in_name/app.py b/tests_functional/issues/519_underscore_in_name/app.py similarity index 95% rename from example/issues/519_underscore_in_name/app.py rename to tests_functional/issues/519_underscore_in_name/app.py index 5b73907cf..a1358c652 100644 --- a/example/issues/519_underscore_in_name/app.py +++ b/tests_functional/issues/519_underscore_in_name/app.py @@ -7,6 +7,7 @@ config = Dynaconf( settings_files=["settings.yml"], envvar_prefix="ATC", + load_dotenv=True, ) # envvar set is case insensitive diff --git a/tests_functional/issues/519_underscore_in_name/settings.yml b/tests_functional/issues/519_underscore_in_name/settings.yml new file mode 100644 index 000000000..73c20525e --- /dev/null +++ b/tests_functional/issues/519_underscore_in_name/settings.yml @@ -0,0 +1,2 @@ +ble: + device_id: -1 diff --git a/example/issues/685_disable_dotted_lookup/app.py b/tests_functional/issues/685_disable_dotted_lookup/app.py similarity index 100% rename from example/issues/685_disable_dotted_lookup/app.py rename to tests_functional/issues/685_disable_dotted_lookup/app.py diff --git a/example/issues/685_disable_dotted_lookup/settings.yaml b/tests_functional/issues/685_disable_dotted_lookup/settings.yaml similarity index 100% rename from example/issues/685_disable_dotted_lookup/settings.yaml rename to tests_functional/issues/685_disable_dotted_lookup/settings.yaml diff --git a/tests_functional/issues/705_flask_dynaconf_init/Makefile b/tests_functional/issues/705_flask_dynaconf_init/Makefile new file mode 100644 index 000000000..1c857e009 --- /dev/null +++ b/tests_functional/issues/705_flask_dynaconf_init/Makefile @@ -0,0 +1,8 @@ +.PHONY: test + +export FLASK_APP=app:create_app + +test: + dynaconf init -v test_var || true + # if settings.toml exists exit with error + if [ -f settings.toml ]; then exit 1; fi diff --git a/example/issues/705_flask_dynaconf_init/app.py b/tests_functional/issues/705_flask_dynaconf_init/app.py similarity index 100% rename from example/issues/705_flask_dynaconf_init/app.py rename to tests_functional/issues/705_flask_dynaconf_init/app.py diff --git a/example/issues/709_yaml_merge_with_env/.env b/tests_functional/issues/709_yaml_merge_with_env/.env similarity index 100% rename from example/issues/709_yaml_merge_with_env/.env rename to tests_functional/issues/709_yaml_merge_with_env/.env diff --git a/example/issues/709_yaml_merge_with_env/app.py b/tests_functional/issues/709_yaml_merge_with_env/app.py similarity index 100% rename from example/issues/709_yaml_merge_with_env/app.py rename to tests_functional/issues/709_yaml_merge_with_env/app.py diff --git a/example/issues/709_yaml_merge_with_env/settings.yaml b/tests_functional/issues/709_yaml_merge_with_env/settings.yaml similarity index 100% rename from example/issues/709_yaml_merge_with_env/settings.yaml rename to tests_functional/issues/709_yaml_merge_with_env/settings.yaml diff --git a/example/issues/718_dynaconf_dotted_lookup/app.py b/tests_functional/issues/718_dynaconf_dotted_lookup/app.py similarity index 100% rename from example/issues/718_dynaconf_dotted_lookup/app.py rename to tests_functional/issues/718_dynaconf_dotted_lookup/app.py diff --git a/example/issues/718_dynaconf_dotted_lookup/settings.yaml b/tests_functional/issues/718_dynaconf_dotted_lookup/settings.yaml similarity index 100% rename from example/issues/718_dynaconf_dotted_lookup/settings.yaml rename to tests_functional/issues/718_dynaconf_dotted_lookup/settings.yaml diff --git a/example/issues/720_load_dotenv/.env b/tests_functional/issues/720_load_dotenv/.env similarity index 100% rename from example/issues/720_load_dotenv/.env rename to tests_functional/issues/720_load_dotenv/.env diff --git a/example/issues/720_load_dotenv/config/settings-staging.yaml b/tests_functional/issues/720_load_dotenv/config/settings-staging.yaml similarity index 100% rename from example/issues/720_load_dotenv/config/settings-staging.yaml rename to tests_functional/issues/720_load_dotenv/config/settings-staging.yaml diff --git a/example/issues/720_load_dotenv/config/settings.yaml b/tests_functional/issues/720_load_dotenv/config/settings.yaml similarity index 100% rename from example/issues/720_load_dotenv/config/settings.yaml rename to tests_functional/issues/720_load_dotenv/config/settings.yaml diff --git a/example/issues/720_load_dotenv/src/app/app.py b/tests_functional/issues/720_load_dotenv/src/app/app.py similarity index 100% rename from example/issues/720_load_dotenv/src/app/app.py rename to tests_functional/issues/720_load_dotenv/src/app/app.py diff --git a/example/issues/722_docs_example/.env b/tests_functional/issues/722_docs_example/.env similarity index 100% rename from example/issues/722_docs_example/.env rename to tests_functional/issues/722_docs_example/.env diff --git a/example/issues/722_docs_example/app.py b/tests_functional/issues/722_docs_example/app.py similarity index 100% rename from example/issues/722_docs_example/app.py rename to tests_functional/issues/722_docs_example/app.py diff --git a/example/issues/729_use_default_when_setting_is_blank/app.py b/tests_functional/issues/729_use_default_when_setting_is_blank/app.py similarity index 100% rename from example/issues/729_use_default_when_setting_is_blank/app.py rename to tests_functional/issues/729_use_default_when_setting_is_blank/app.py diff --git a/example/issues/729_use_default_when_setting_is_blank/settings.yaml b/tests_functional/issues/729_use_default_when_setting_is_blank/settings.yaml similarity index 100% rename from example/issues/729_use_default_when_setting_is_blank/settings.yaml rename to tests_functional/issues/729_use_default_when_setting_is_blank/settings.yaml diff --git a/example/issues/734_validate_only_current_env/app.py b/tests_functional/issues/734_validate_only_current_env/app.py similarity index 100% rename from example/issues/734_validate_only_current_env/app.py rename to tests_functional/issues/734_validate_only_current_env/app.py diff --git a/example/issues/734_validate_only_current_env/settings.toml b/tests_functional/issues/734_validate_only_current_env/settings.toml similarity index 100% rename from example/issues/734_validate_only_current_env/settings.toml rename to tests_functional/issues/734_validate_only_current_env/settings.toml diff --git a/example/issues/741_envvars_ignored/app.py b/tests_functional/issues/741_envvars_ignored/app.py similarity index 100% rename from example/issues/741_envvars_ignored/app.py rename to tests_functional/issues/741_envvars_ignored/app.py diff --git a/example/issues/741_envvars_ignored/nested.yaml b/tests_functional/issues/741_envvars_ignored/nested.yaml similarity index 100% rename from example/issues/741_envvars_ignored/nested.yaml rename to tests_functional/issues/741_envvars_ignored/nested.yaml diff --git a/example/issues/741_envvars_ignored/recreate.sh b/tests_functional/issues/741_envvars_ignored/test.sh similarity index 100% rename from example/issues/741_envvars_ignored/recreate.sh rename to tests_functional/issues/741_envvars_ignored/test.sh diff --git a/example/issues/794_includes/app.py b/tests_functional/issues/794_includes/app.py similarity index 100% rename from example/issues/794_includes/app.py rename to tests_functional/issues/794_includes/app.py diff --git a/example/issues/794_includes/conf/database/postgre.toml b/tests_functional/issues/794_includes/conf/database/postgre.toml similarity index 100% rename from example/issues/794_includes/conf/database/postgre.toml rename to tests_functional/issues/794_includes/conf/database/postgre.toml diff --git a/example/issues/794_includes/conf/settings.toml b/tests_functional/issues/794_includes/conf/settings.toml similarity index 100% rename from example/issues/794_includes/conf/settings.toml rename to tests_functional/issues/794_includes/conf/settings.toml diff --git a/example/issues/799_negative_numbers/app.py b/tests_functional/issues/799_negative_numbers/app.py similarity index 100% rename from example/issues/799_negative_numbers/app.py rename to tests_functional/issues/799_negative_numbers/app.py diff --git a/tests_functional/issues/799_negative_numbers/env.toml b/tests_functional/issues/799_negative_numbers/env.toml new file mode 100644 index 000000000..0ff7e6a02 --- /dev/null +++ b/tests_functional/issues/799_negative_numbers/env.toml @@ -0,0 +1 @@ +DYNACONF_NUM = "-1" diff --git a/tests_functional/issues/799_negative_numbers/settings.toml b/tests_functional/issues/799_negative_numbers/settings.toml new file mode 100644 index 000000000..d354383f1 --- /dev/null +++ b/tests_functional/issues/799_negative_numbers/settings.toml @@ -0,0 +1 @@ +num = 1 diff --git a/example/jenkins_secrets_file/.env b/tests_functional/jenkins_secrets_file/.env similarity index 100% rename from example/jenkins_secrets_file/.env rename to tests_functional/jenkins_secrets_file/.env diff --git a/tests_functional/jenkins_secrets_file/Makefile b/tests_functional/jenkins_secrets_file/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/jenkins_secrets_file/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/jenkins_secrets_file/app.py b/tests_functional/jenkins_secrets_file/app.py similarity index 100% rename from example/jenkins_secrets_file/app.py rename to tests_functional/jenkins_secrets_file/app.py diff --git a/example/jenkins_secrets_file/jenkins_secrets.toml b/tests_functional/jenkins_secrets_file/jenkins_secrets.toml similarity index 100% rename from example/jenkins_secrets_file/jenkins_secrets.toml rename to tests_functional/jenkins_secrets_file/jenkins_secrets.toml diff --git a/example/jenkins_secrets_file/settings.toml b/tests_functional/jenkins_secrets_file/settings.toml similarity index 100% rename from example/jenkins_secrets_file/settings.toml rename to tests_functional/jenkins_secrets_file/settings.toml diff --git a/example/lower_read/.env b/tests_functional/lower_read/.env similarity index 100% rename from example/lower_read/.env rename to tests_functional/lower_read/.env diff --git a/tests_functional/lower_read/Makefile b/tests_functional/lower_read/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/lower_read/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/lower_read/app.py b/tests_functional/lower_read/app.py similarity index 100% rename from example/lower_read/app.py rename to tests_functional/lower_read/app.py diff --git a/example/lower_read/settings.yaml b/tests_functional/lower_read/settings.yaml similarity index 100% rename from example/lower_read/settings.yaml rename to tests_functional/lower_read/settings.yaml diff --git a/example/merge_enabled/.env b/tests_functional/merge_enabled/.env similarity index 100% rename from example/merge_enabled/.env rename to tests_functional/merge_enabled/.env diff --git a/tests_functional/merge_enabled/Makefile b/tests_functional/merge_enabled/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/merge_enabled/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/merge_enabled/app.py b/tests_functional/merge_enabled/app.py similarity index 100% rename from example/merge_enabled/app.py rename to tests_functional/merge_enabled/app.py diff --git a/example/merge_enabled/development_settings.py b/tests_functional/merge_enabled/development_settings.py similarity index 100% rename from example/merge_enabled/development_settings.py rename to tests_functional/merge_enabled/development_settings.py diff --git a/example/merge_enabled/global_settings.py b/tests_functional/merge_enabled/global_settings.py similarity index 100% rename from example/merge_enabled/global_settings.py rename to tests_functional/merge_enabled/global_settings.py diff --git a/example/merge_enabled/production_settings.py b/tests_functional/merge_enabled/production_settings.py similarity index 100% rename from example/merge_enabled/production_settings.py rename to tests_functional/merge_enabled/production_settings.py diff --git a/example/merge_enabled/settings.conf b/tests_functional/merge_enabled/settings.conf similarity index 100% rename from example/merge_enabled/settings.conf rename to tests_functional/merge_enabled/settings.conf diff --git a/example/merge_enabled/settings.ini b/tests_functional/merge_enabled/settings.ini similarity index 100% rename from example/merge_enabled/settings.ini rename to tests_functional/merge_enabled/settings.ini diff --git a/example/merge_enabled/settings.json b/tests_functional/merge_enabled/settings.json similarity index 100% rename from example/merge_enabled/settings.json rename to tests_functional/merge_enabled/settings.json diff --git a/example/merge_enabled/settings.properties b/tests_functional/merge_enabled/settings.properties similarity index 100% rename from example/merge_enabled/settings.properties rename to tests_functional/merge_enabled/settings.properties diff --git a/example/merge_enabled/settings.py b/tests_functional/merge_enabled/settings.py similarity index 100% rename from example/merge_enabled/settings.py rename to tests_functional/merge_enabled/settings.py diff --git a/example/merge_enabled/settings.tml b/tests_functional/merge_enabled/settings.tml similarity index 100% rename from example/merge_enabled/settings.tml rename to tests_functional/merge_enabled/settings.tml diff --git a/example/merge_enabled/settings.toml b/tests_functional/merge_enabled/settings.toml similarity index 100% rename from example/merge_enabled/settings.toml rename to tests_functional/merge_enabled/settings.toml diff --git a/example/merge_enabled/settings.yaml b/tests_functional/merge_enabled/settings.yaml similarity index 100% rename from example/merge_enabled/settings.yaml rename to tests_functional/merge_enabled/settings.yaml diff --git a/example/merge_enabled/settings.yml b/tests_functional/merge_enabled/settings.yml similarity index 100% rename from example/merge_enabled/settings.yml rename to tests_functional/merge_enabled/settings.yml diff --git a/example/module_impersonation/main.py b/tests_functional/module_impersonation/app.py similarity index 100% rename from example/module_impersonation/main.py rename to tests_functional/module_impersonation/app.py diff --git a/example/module_impersonation/settings.py b/tests_functional/module_impersonation/settings.py similarity index 100% rename from example/module_impersonation/settings.py rename to tests_functional/module_impersonation/settings.py diff --git a/example/module_impersonation/settings.toml b/tests_functional/module_impersonation/settings.toml similarity index 100% rename from example/module_impersonation/settings.toml rename to tests_functional/module_impersonation/settings.toml diff --git a/example/multiple_folders/.env b/tests_functional/multiple_folders/.env similarity index 100% rename from example/multiple_folders/.env rename to tests_functional/multiple_folders/.env diff --git a/tests_functional/multiple_folders/Makefile b/tests_functional/multiple_folders/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/multiple_folders/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/multiple_folders/app.py b/tests_functional/multiple_folders/app.py similarity index 100% rename from example/multiple_folders/app.py rename to tests_functional/multiple_folders/app.py diff --git a/example/multiple_folders/config_1/__init__.py b/tests_functional/multiple_folders/config_1/__init__.py similarity index 100% rename from example/multiple_folders/config_1/__init__.py rename to tests_functional/multiple_folders/config_1/__init__.py diff --git a/example/multiple_folders/config_1/settings.toml b/tests_functional/multiple_folders/config_1/settings.toml similarity index 100% rename from example/multiple_folders/config_1/settings.toml rename to tests_functional/multiple_folders/config_1/settings.toml diff --git a/example/multiple_folders/config_2/__init__.py b/tests_functional/multiple_folders/config_2/__init__.py similarity index 100% rename from example/multiple_folders/config_2/__init__.py rename to tests_functional/multiple_folders/config_2/__init__.py diff --git a/example/multiple_folders/config_2/settings.toml b/tests_functional/multiple_folders/config_2/settings.toml similarity index 100% rename from example/multiple_folders/config_2/settings.toml rename to tests_functional/multiple_folders/config_2/settings.toml diff --git a/example/multiple_sources/.env b/tests_functional/multiple_sources/.env similarity index 100% rename from example/multiple_sources/.env rename to tests_functional/multiple_sources/.env diff --git a/tests_functional/multiple_sources/Makefile b/tests_functional/multiple_sources/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/multiple_sources/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/multiple_sources/app.py b/tests_functional/multiple_sources/app.py similarity index 100% rename from example/multiple_sources/app.py rename to tests_functional/multiple_sources/app.py diff --git a/example/multiple_sources/development_settings.py b/tests_functional/multiple_sources/development_settings.py similarity index 100% rename from example/multiple_sources/development_settings.py rename to tests_functional/multiple_sources/development_settings.py diff --git a/example/multiple_sources/global_settings.py b/tests_functional/multiple_sources/global_settings.py similarity index 100% rename from example/multiple_sources/global_settings.py rename to tests_functional/multiple_sources/global_settings.py diff --git a/example/multiple_sources/production_settings.py b/tests_functional/multiple_sources/production_settings.py similarity index 100% rename from example/multiple_sources/production_settings.py rename to tests_functional/multiple_sources/production_settings.py diff --git a/example/multiple_sources/settings.conf b/tests_functional/multiple_sources/settings.conf similarity index 100% rename from example/multiple_sources/settings.conf rename to tests_functional/multiple_sources/settings.conf diff --git a/example/multiple_sources/settings.ini b/tests_functional/multiple_sources/settings.ini similarity index 100% rename from example/multiple_sources/settings.ini rename to tests_functional/multiple_sources/settings.ini diff --git a/example/multiple_sources/settings.json b/tests_functional/multiple_sources/settings.json similarity index 100% rename from example/multiple_sources/settings.json rename to tests_functional/multiple_sources/settings.json diff --git a/example/multiple_sources/settings.properties b/tests_functional/multiple_sources/settings.properties similarity index 100% rename from example/multiple_sources/settings.properties rename to tests_functional/multiple_sources/settings.properties diff --git a/example/multiple_sources/settings.py b/tests_functional/multiple_sources/settings.py similarity index 100% rename from example/multiple_sources/settings.py rename to tests_functional/multiple_sources/settings.py diff --git a/example/multiple_sources/settings.tml b/tests_functional/multiple_sources/settings.tml similarity index 100% rename from example/multiple_sources/settings.tml rename to tests_functional/multiple_sources/settings.tml diff --git a/example/multiple_sources/settings.toml b/tests_functional/multiple_sources/settings.toml similarity index 100% rename from example/multiple_sources/settings.toml rename to tests_functional/multiple_sources/settings.toml diff --git a/example/multiple_sources/settings.yaml b/tests_functional/multiple_sources/settings.yaml similarity index 100% rename from example/multiple_sources/settings.yaml rename to tests_functional/multiple_sources/settings.yaml diff --git a/example/multiple_sources/settings.yml b/tests_functional/multiple_sources/settings.yml similarity index 100% rename from example/multiple_sources/settings.yml rename to tests_functional/multiple_sources/settings.yml diff --git a/example/new_merge/.env b/tests_functional/new_merge/.env similarity index 100% rename from example/new_merge/.env rename to tests_functional/new_merge/.env diff --git a/tests_functional/new_merge/Makefile b/tests_functional/new_merge/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/new_merge/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/new_merge/app.py b/tests_functional/new_merge/app.py similarity index 100% rename from example/new_merge/app.py rename to tests_functional/new_merge/app.py diff --git a/example/new_merge/settings.local.py b/tests_functional/new_merge/settings.local.py similarity index 100% rename from example/new_merge/settings.local.py rename to tests_functional/new_merge/settings.local.py diff --git a/example/new_merge/settings.local.toml b/tests_functional/new_merge/settings.local.toml similarity index 100% rename from example/new_merge/settings.local.toml rename to tests_functional/new_merge/settings.local.toml diff --git a/example/new_merge/settings.local.yaml b/tests_functional/new_merge/settings.local.yaml similarity index 100% rename from example/new_merge/settings.local.yaml rename to tests_functional/new_merge/settings.local.yaml diff --git a/example/new_merge/settings.py b/tests_functional/new_merge/settings.py similarity index 100% rename from example/new_merge/settings.py rename to tests_functional/new_merge/settings.py diff --git a/example/new_merge/settings.toml b/tests_functional/new_merge/settings.toml similarity index 100% rename from example/new_merge/settings.toml rename to tests_functional/new_merge/settings.toml diff --git a/example/new_merge/settings.yaml b/tests_functional/new_merge/settings.yaml similarity index 100% rename from example/new_merge/settings.yaml rename to tests_functional/new_merge/settings.yaml diff --git a/example/overriding/.env b/tests_functional/overriding/.env similarity index 100% rename from example/overriding/.env rename to tests_functional/overriding/.env diff --git a/tests_functional/overriding/Makefile b/tests_functional/overriding/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/overriding/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/overriding/app.py b/tests_functional/overriding/app.py similarity index 100% rename from example/overriding/app.py rename to tests_functional/overriding/app.py diff --git a/example/overriding/settings.py b/tests_functional/overriding/settings.py similarity index 100% rename from example/overriding/settings.py rename to tests_functional/overriding/settings.py diff --git a/example/overriding/user_settings.py b/tests_functional/overriding/user_settings.py similarity index 100% rename from example/overriding/user_settings.py rename to tests_functional/overriding/user_settings.py diff --git a/example/project_root/.env b/tests_functional/project_root/.env similarity index 100% rename from example/project_root/.env rename to tests_functional/project_root/.env diff --git a/tests_functional/project_root/Makefile b/tests_functional/project_root/Makefile new file mode 100644 index 000000000..75f10ed9b --- /dev/null +++ b/tests_functional/project_root/Makefile @@ -0,0 +1,8 @@ +.PHONY: test + +test: + rm -rf /tmp/dynaconf_project_root_test/settings.py + mkdir -p /tmp/dynaconf_project_root_test/ + echo "MESSAGE = 'Hello from tmp'" > /tmp/dynaconf_project_root_test/settings.py + python app.py + rm -rf /tmp/dynaconf_project_root_test/ diff --git a/example/project_root/app.py b/tests_functional/project_root/app.py similarity index 100% rename from example/project_root/app.py rename to tests_functional/project_root/app.py diff --git a/example/pytest_example/app/.env b/tests_functional/pytest_example/app/.env similarity index 100% rename from example/pytest_example/app/.env rename to tests_functional/pytest_example/app/.env diff --git a/tests_functional/pytest_example/app/Makefile b/tests_functional/pytest_example/app/Makefile new file mode 100644 index 000000000..a2354932c --- /dev/null +++ b/tests_functional/pytest_example/app/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + pytest tests diff --git a/example/pytest_example/app/app.py b/tests_functional/pytest_example/app/app.py similarity index 100% rename from example/pytest_example/app/app.py rename to tests_functional/pytest_example/app/app.py diff --git a/example/pytest_example/app/settings.toml b/tests_functional/pytest_example/app/settings.toml similarity index 100% rename from example/pytest_example/app/settings.toml rename to tests_functional/pytest_example/app/settings.toml diff --git a/example/pytest_example/app/tests/__init__.py b/tests_functional/pytest_example/app/tests/__init__.py similarity index 100% rename from example/pytest_example/app/tests/__init__.py rename to tests_functional/pytest_example/app/tests/__init__.py diff --git a/example/pytest_example/app/tests/conftest.py b/tests_functional/pytest_example/app/tests/conftest.py similarity index 100% rename from example/pytest_example/app/tests/conftest.py rename to tests_functional/pytest_example/app/tests/conftest.py diff --git a/example/pytest_example/app/tests/test_dynaconf.py b/tests_functional/pytest_example/app/tests/test_dynaconf.py similarity index 100% rename from example/pytest_example/app/tests/test_dynaconf.py rename to tests_functional/pytest_example/app/tests/test_dynaconf.py diff --git a/example/pytest_example/flask/.env b/tests_functional/pytest_example/flask/.env similarity index 100% rename from example/pytest_example/flask/.env rename to tests_functional/pytest_example/flask/.env diff --git a/tests_functional/pytest_example/flask/Makefile b/tests_functional/pytest_example/flask/Makefile new file mode 100644 index 000000000..a2354932c --- /dev/null +++ b/tests_functional/pytest_example/flask/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + pytest tests diff --git a/example/pytest_example/flask/settings.toml b/tests_functional/pytest_example/flask/settings.toml similarity index 100% rename from example/pytest_example/flask/settings.toml rename to tests_functional/pytest_example/flask/settings.toml diff --git a/example/pytest_example/flask/src.py b/tests_functional/pytest_example/flask/src.py similarity index 100% rename from example/pytest_example/flask/src.py rename to tests_functional/pytest_example/flask/src.py diff --git a/example/pytest_example/flask/tests/__init__.py b/tests_functional/pytest_example/flask/tests/__init__.py similarity index 100% rename from example/pytest_example/flask/tests/__init__.py rename to tests_functional/pytest_example/flask/tests/__init__.py diff --git a/example/pytest_example/flask/tests/conftest.py b/tests_functional/pytest_example/flask/tests/conftest.py similarity index 100% rename from example/pytest_example/flask/tests/conftest.py rename to tests_functional/pytest_example/flask/tests/conftest.py diff --git a/example/pytest_example/flask/tests/test_flask_dynaconf.py b/tests_functional/pytest_example/flask/tests/test_flask_dynaconf.py similarity index 100% rename from example/pytest_example/flask/tests/test_flask_dynaconf.py rename to tests_functional/pytest_example/flask/tests/test_flask_dynaconf.py diff --git a/example/python_loader/app.py b/tests_functional/python_loader/app.py similarity index 100% rename from example/python_loader/app.py rename to tests_functional/python_loader/app.py diff --git a/example/python_loader/setting.py b/tests_functional/python_loader/setting.py similarity index 100% rename from example/python_loader/setting.py rename to tests_functional/python_loader/setting.py diff --git a/example/python_loader_with_hooks/app.py b/tests_functional/python_loader_with_hooks/app.py similarity index 100% rename from example/python_loader_with_hooks/app.py rename to tests_functional/python_loader_with_hooks/app.py diff --git a/example/python_loader_with_hooks/dynaconf_hooks.py b/tests_functional/python_loader_with_hooks/dynaconf_hooks.py similarity index 100% rename from example/python_loader_with_hooks/dynaconf_hooks.py rename to tests_functional/python_loader_with_hooks/dynaconf_hooks.py diff --git a/example/python_loader_with_hooks/setting.py b/tests_functional/python_loader_with_hooks/setting.py similarity index 100% rename from example/python_loader_with_hooks/setting.py rename to tests_functional/python_loader_with_hooks/setting.py diff --git a/example/redis_example/.env b/tests_functional/redis_example/.env similarity index 100% rename from example/redis_example/.env rename to tests_functional/redis_example/.env diff --git a/example/redis_example/redis_example.py b/tests_functional/redis_example/redis_example.py similarity index 100% rename from example/redis_example/redis_example.py rename to tests_functional/redis_example/redis_example.py diff --git a/example/redis_example/write.py b/tests_functional/redis_example/write.py similarity index 100% rename from example/redis_example/write.py rename to tests_functional/redis_example/write.py diff --git a/tests_functional/runtests.py b/tests_functional/runtests.py new file mode 100755 index 000000000..8e6ba0c32 --- /dev/null +++ b/tests_functional/runtests.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 +from __future__ import annotations + +import os +import subprocess +import sys +from pathlib import Path +from time import sleep + +from dynaconf.vendor.tomllib import load + + +HERE = Path(__file__).parent +skips = load(open(HERE / "skipfile.toml", "rb")).get(os.name, []) + +print("Starting Functional Tests") +print("-" * 40) + + +def execute_test(filename, cmd, path, env): + if (path / filename).exists(): + print(f"Running {filename}") + try: + subprocess.check_call(cmd, cwd=path, env=env) + except subprocess.CalledProcessError: + print(f"################# Failed on {path}") + + # try to also execute from parent folder + if filename not in ["Makefile", "test.sh"]: + print("Running from parent folder") + try: + subprocess.check_call( + [sys.executable, path.resolve() / filename], + cwd=path.parent, + env=env, + ) + except subprocess.CalledProcessError: + print("################# Failed to run from parent folder") + + return True # test executed with success + return False # test not executed because file not found + + +def execute_tests(path): + print("-" * 40) + print("Starting Test on:", path) + + if path.name in skips: + print(f"Skipping {path} on {os.name}") + return True + + env = {**os.environ} + if os.path.exists(path / "env.toml"): + print("Loading env.toml") + _envvars = load(open(path / "env.toml", "rb")) + env.update(_envvars) + + # Order matters + test_files = [ + ("Makefile", ["make", "test"]), + ("test.sh", ["bash", "test.sh"]), + ("test.py", [sys.executable, "test.py"]), + ("app.py", [sys.executable, "app.py"]), + ("program.py", [sys.executable, "program.py"]), + ("manage.py", [sys.executable, "manage.py", "test"]), + ] + + for filename, cmd in test_files: + if execute_test(filename, cmd, path, env): + return True + return False + + +def run_tests(): + executed = 0 + root_directory = Path(__file__).parent + print("Workdir:", root_directory.absolute()) + functional_tests = sorted(list(root_directory.iterdir())) + print("Collected functional tests:", len(functional_tests)) + sleep(1) + for path in functional_tests: + if path.is_dir(): + if path.name in [".", "__pycache__"]: + continue + + if execute_tests(path): + executed += 1 + continue + + # Now Subdirectories one level + subdirs = sorted(list(path.iterdir())) + for subdir in subdirs: + if subdir.is_dir(): + if subdir.name in [".", "__pycache__"]: + continue + + if execute_tests(subdir): + executed += 1 + continue + + if not subdirs: + exit( + "WARNING: Can't find Makefile, app.py, test.py, program.py" + ) + + print(f"{executed} functional tests passed") + + +if __name__ == "__main__": + run_tests() diff --git a/example/settings_file/.env b/tests_functional/settings_file/.env similarity index 100% rename from example/settings_file/.env rename to tests_functional/settings_file/.env diff --git a/tests_functional/settings_file/Makefile b/tests_functional/settings_file/Makefile new file mode 100644 index 000000000..a92137b7f --- /dev/null +++ b/tests_functional/settings_file/Makefile @@ -0,0 +1,8 @@ +.PHONY: test + +test: + rm -rf /tmp/settings_file_test/settings.py + mkdir -p /tmp/settings_file_test/ + echo "MESSAGE = 'Hello from tmp'" > /tmp/settings_file_test/settings.py + python app.py + rm -rf /tmp/settings_file_test/ diff --git a/example/settings_file/app.py b/tests_functional/settings_file/app.py similarity index 100% rename from example/settings_file/app.py rename to tests_functional/settings_file/app.py diff --git a/example/simple/.env b/tests_functional/simple/.env similarity index 100% rename from example/simple/.env rename to tests_functional/simple/.env diff --git a/example/simple/.gitignore b/tests_functional/simple/.gitignore similarity index 100% rename from example/simple/.gitignore rename to tests_functional/simple/.gitignore diff --git a/tests_functional/simple/Makefile b/tests_functional/simple/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/simple/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/simple/app.py b/tests_functional/simple/app.py similarity index 100% rename from example/simple/app.py rename to tests_functional/simple/app.py diff --git a/example/simple/settings.py b/tests_functional/simple/settings.py similarity index 100% rename from example/simple/settings.py rename to tests_functional/simple/settings.py diff --git a/example/simple/settings.toml b/tests_functional/simple/settings.toml similarity index 100% rename from example/simple/settings.toml rename to tests_functional/simple/settings.toml diff --git a/example/simple_ini_example/app.py b/tests_functional/simple_ini_example/app.py similarity index 100% rename from example/simple_ini_example/app.py rename to tests_functional/simple_ini_example/app.py diff --git a/example/simple_ini_example/config.toml b/tests_functional/simple_ini_example/config.toml similarity index 100% rename from example/simple_ini_example/config.toml rename to tests_functional/simple_ini_example/config.toml diff --git a/tests_functional/simple_ini_example/env.toml b/tests_functional/simple_ini_example/env.toml new file mode 100644 index 000000000..55b320489 --- /dev/null +++ b/tests_functional/simple_ini_example/env.toml @@ -0,0 +1 @@ +TEFLO_LOG_LEVEL = "debug" diff --git a/tests_functional/skipfile.toml b/tests_functional/skipfile.toml new file mode 100644 index 000000000..113a76a2b --- /dev/null +++ b/tests_functional/skipfile.toml @@ -0,0 +1,21 @@ +nt = [ + "app_with_dotenv", + "configure", + "custom_cast_token", + "envless_mode", + "format", + "django_example", + "django_example_compat", + "django_pytest", + "djang_pytest_pure", + "flask_with_commentjson", + "project_root", + "settings_file", + "toml_with_secrets", + "160_path_traversal_fixed", + "184_ipython", + "434_setenv", + "449_django_lazy_path", + "685_disable_dotted_lookup", + "741_envvars_ignored", +] diff --git a/example/specific_settings_files/.env b/tests_functional/specific_settings_files/.env similarity index 100% rename from example/specific_settings_files/.env rename to tests_functional/specific_settings_files/.env diff --git a/tests_functional/specific_settings_files/Makefile b/tests_functional/specific_settings_files/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/specific_settings_files/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/specific_settings_files/app.py b/tests_functional/specific_settings_files/app.py similarity index 100% rename from example/specific_settings_files/app.py rename to tests_functional/specific_settings_files/app.py diff --git a/example/specific_settings_files/extra_settings.py b/tests_functional/specific_settings_files/extra_settings.py similarity index 100% rename from example/specific_settings_files/extra_settings.py rename to tests_functional/specific_settings_files/extra_settings.py diff --git a/example/specific_settings_files/first_settings.toml b/tests_functional/specific_settings_files/first_settings.toml similarity index 100% rename from example/specific_settings_files/first_settings.toml rename to tests_functional/specific_settings_files/first_settings.toml diff --git a/example/specific_settings_files/second_settings.toml b/tests_functional/specific_settings_files/second_settings.toml similarity index 100% rename from example/specific_settings_files/second_settings.toml rename to tests_functional/specific_settings_files/second_settings.toml diff --git a/tests_functional/test_redis.sh b/tests_functional/test_redis.sh new file mode 100755 index 000000000..a5edef972 --- /dev/null +++ b/tests_functional/test_redis.sh @@ -0,0 +1,13 @@ +#!/bin/bash +docker run --rm --name dynaconf_with_redis -d -p 6379:6379 redis:alpine || true +sleep 2 +cd tests_functional/redis_example +pwd +dynaconf -i dynaconf.settings write redis -s FOO=foo_is_default +dynaconf -i dynaconf.settings write redis -s SECRET=redis_works_in_default +dynaconf -i dynaconf.settings write redis -e development -s SECRET=redis_works_in_development +dynaconf -i dynaconf.settings write redis -e production -s SECRET=redis_works_in_production +sleep 2 +python redis_example.py +docker stop dynaconf_with_redis || true +cd ../../ diff --git a/tests_functional/test_vault.sh b/tests_functional/test_vault.sh new file mode 100755 index 000000000..8e93bf753 --- /dev/null +++ b/tests_functional/test_vault.sh @@ -0,0 +1,12 @@ +#!/bin/bash +docker run --rm --name dynaconf_with_vault -d -e 'VAULT_DEV_ROOT_TOKEN_ID=myroot' -p 8200:8200 vault || true +sleep 5 +cd tests_functional/vault +pwd +dynaconf -i dynaconf.settings write vault -s SECRET=vault_works_in_default -s FOO=foo_is_default +dynaconf -i dynaconf.settings write vault -e dev -s SECRET=vault_works_in_dev +dynaconf -i dynaconf.settings write vault -e prod -s SECRET=vault_works_in_prod +sleep 2 +python vault_example.py +docker stop dynaconf_with_vault || true +cd ../../ diff --git a/example/toml_example/app.py b/tests_functional/toml_example/app.py similarity index 100% rename from example/toml_example/app.py rename to tests_functional/toml_example/app.py diff --git a/example/toml_example/settings.toml b/tests_functional/toml_example/settings.toml similarity index 100% rename from example/toml_example/settings.toml rename to tests_functional/toml_example/settings.toml diff --git a/example/toml_with_secrets/.env b/tests_functional/toml_with_secrets/.env similarity index 100% rename from example/toml_with_secrets/.env rename to tests_functional/toml_with_secrets/.env diff --git a/example/toml_with_secrets/.secrets.toml b/tests_functional/toml_with_secrets/.secrets.toml similarity index 100% rename from example/toml_with_secrets/.secrets.toml rename to tests_functional/toml_with_secrets/.secrets.toml diff --git a/tests_functional/toml_with_secrets/Makefile b/tests_functional/toml_with_secrets/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/toml_with_secrets/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/toml_with_secrets/program.py b/tests_functional/toml_with_secrets/program.py similarity index 100% rename from example/toml_with_secrets/program.py rename to tests_functional/toml_with_secrets/program.py diff --git a/example/toml_with_secrets/settings.toml b/tests_functional/toml_with_secrets/settings.toml similarity index 100% rename from example/toml_with_secrets/settings.toml rename to tests_functional/toml_with_secrets/settings.toml diff --git a/example/validators/with_python/.env b/tests_functional/validators/with_python/.env similarity index 100% rename from example/validators/with_python/.env rename to tests_functional/validators/with_python/.env diff --git a/tests_functional/validators/with_python/Makefile b/tests_functional/validators/with_python/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/validators/with_python/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/validators/with_python/__init__.py b/tests_functional/validators/with_python/__init__.py similarity index 100% rename from example/validators/with_python/__init__.py rename to tests_functional/validators/with_python/__init__.py diff --git a/example/validators/with_python/app.py b/tests_functional/validators/with_python/app.py similarity index 100% rename from example/validators/with_python/app.py rename to tests_functional/validators/with_python/app.py diff --git a/example/validators/with_python/conf.py b/tests_functional/validators/with_python/conf.py similarity index 100% rename from example/validators/with_python/conf.py rename to tests_functional/validators/with_python/conf.py diff --git a/example/validators/with_python/development_settings.py b/tests_functional/validators/with_python/development_settings.py similarity index 100% rename from example/validators/with_python/development_settings.py rename to tests_functional/validators/with_python/development_settings.py diff --git a/example/validators/with_python/production_settings.py b/tests_functional/validators/with_python/production_settings.py similarity index 100% rename from example/validators/with_python/production_settings.py rename to tests_functional/validators/with_python/production_settings.py diff --git a/example/validators/with_python/settings.py b/tests_functional/validators/with_python/settings.py similarity index 100% rename from example/validators/with_python/settings.py rename to tests_functional/validators/with_python/settings.py diff --git a/example/validators/with_toml/.env b/tests_functional/validators/with_toml/.env similarity index 100% rename from example/validators/with_toml/.env rename to tests_functional/validators/with_toml/.env diff --git a/tests_functional/validators/with_toml/Makefile b/tests_functional/validators/with_toml/Makefile new file mode 100644 index 000000000..be3c49bb7 --- /dev/null +++ b/tests_functional/validators/with_toml/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + PYTHONPATH=. dynaconf -i config.settings validate diff --git a/example/validators/with_toml/config.py b/tests_functional/validators/with_toml/config.py similarity index 100% rename from example/validators/with_toml/config.py rename to tests_functional/validators/with_toml/config.py diff --git a/example/validators/with_toml/dynaconf_validators.toml b/tests_functional/validators/with_toml/dynaconf_validators.toml similarity index 100% rename from example/validators/with_toml/dynaconf_validators.toml rename to tests_functional/validators/with_toml/dynaconf_validators.toml diff --git a/example/validators/with_toml/settings.toml b/tests_functional/validators/with_toml/settings.toml similarity index 100% rename from example/validators/with_toml/settings.toml rename to tests_functional/validators/with_toml/settings.toml diff --git a/example/vault/.env b/tests_functional/vault/.env similarity index 100% rename from example/vault/.env rename to tests_functional/vault/.env diff --git a/example/vault/vault_example.py b/tests_functional/vault/vault_example.py similarity index 100% rename from example/vault/vault_example.py rename to tests_functional/vault/vault_example.py diff --git a/example/vault/write.py b/tests_functional/vault/write.py similarity index 100% rename from example/vault/write.py rename to tests_functional/vault/write.py diff --git a/example/yaml_example/settings_file/app.py b/tests_functional/yaml_example/settings_file/app.py similarity index 100% rename from example/yaml_example/settings_file/app.py rename to tests_functional/yaml_example/settings_file/app.py diff --git a/example/yaml_example/settings_file/settings.yaml b/tests_functional/yaml_example/settings_file/settings.yaml similarity index 100% rename from example/yaml_example/settings_file/settings.yaml rename to tests_functional/yaml_example/settings_file/settings.yaml diff --git a/example/yaml_example/yaml_as_extra_config/.env b/tests_functional/yaml_example/yaml_as_extra_config/.env similarity index 100% rename from example/yaml_example/yaml_as_extra_config/.env rename to tests_functional/yaml_example/yaml_as_extra_config/.env diff --git a/tests_functional/yaml_example/yaml_as_extra_config/Makefile b/tests_functional/yaml_example/yaml_as_extra_config/Makefile new file mode 100644 index 000000000..915ded6b7 --- /dev/null +++ b/tests_functional/yaml_example/yaml_as_extra_config/Makefile @@ -0,0 +1,4 @@ +.PHONY: test + +test: + python app.py diff --git a/example/yaml_example/yaml_as_extra_config/app.py b/tests_functional/yaml_example/yaml_as_extra_config/app.py similarity index 100% rename from example/yaml_example/yaml_as_extra_config/app.py rename to tests_functional/yaml_example/yaml_as_extra_config/app.py diff --git a/example/yaml_example/yaml_as_extra_config/extra_settings.yaml b/tests_functional/yaml_example/yaml_as_extra_config/extra_settings.yaml similarity index 100% rename from example/yaml_example/yaml_as_extra_config/extra_settings.yaml rename to tests_functional/yaml_example/yaml_as_extra_config/extra_settings.yaml diff --git a/example/yaml_example/yaml_as_extra_config/settings.py b/tests_functional/yaml_example/yaml_as_extra_config/settings.py similarity index 100% rename from example/yaml_example/yaml_as_extra_config/settings.py rename to tests_functional/yaml_example/yaml_as_extra_config/settings.py