Commit Graph

5 Commits

Author SHA1 Message Date
Federico Bond 679409fad2
feat: implement provider events (#278)
* feat: implement provider events

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: add error_code field to EventDetails and ProviderEventDetails

Signed-off-by: Federico Bond <federicobond@gmail.com>

* fix: replace strings with postponed evaluation of annotations

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: run handlers immediately if provider already in associated state

Signed-off-by: Federico Bond <federicobond@gmail.com>

* feat: remove unused _provider from openfeature.api

Signed-off-by: Federico Bond <federicobond@gmail.com>

* test: add some comments to test cases

Signed-off-by: Federico Bond <federicobond@gmail.com>

* test: add provider event late binding test cases

Signed-off-by: Federico Bond <federicobond@gmail.com>

* fix: fix status handlers running immediately if provider already in associated state

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: reuse provider property in OpenFeatureClient

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: move _provider_status_to_event to ProviderEvent.from_provider_status

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: move EventSupport class to an internal module

Signed-off-by: Federico Bond <federicobond@gmail.com>

* refactor: replace EventSupport class with module-level functions

Signed-off-by: Federico Bond <federicobond@gmail.com>

* style: fix code style

---------

Signed-off-by: Federico Bond <federicobond@gmail.com>
2024-03-22 07:45:00 +11:00
Anton Grübel a853b85514
chore: remove excluded ruff rules and fix issues (#254)
remove excluded ruff rules and fix issues

Signed-off-by: gruebel <anton.gruebel@gmail.com>
2024-01-06 14:25:44 -03:00
Federico Bond 51f0d260f0
refactor!: rename top-level package to openfeature (#192)
Signed-off-by: Federico Bond <federicobond@gmail.com>
2023-09-20 13:22:31 -03:00
Federico Bond 793ced1917
refactor!: simplify namespaces to make public API more pythonic (#172)
* refactor!: simplify namespaces to make public API more pythonic

Signed-off-by: Federico Bond <federicobond@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
2023-09-08 10:31:25 -04:00
Andrew Helsby df0c033083
fix: Unit tests (#28)
* fix/unit-tests: Improve unit test coverage to ensure spec is followed
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Add test coverage around hooks
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Parametrize test_should_use_no_op_provider_if_none_provided
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Parametrize all flag type methods in open feature client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Parametrize all flag type methods in open feature client
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Add fixture to clear global provider after each tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Mock hooks in tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Update docstring on clear_provider method
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: remove setup method in client tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* fix/unit-tests: Remove invalid flag type check in private method _create_provider_evaluation and move to public method
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
2022-11-02 16:24:16 +04:00