Skip to content

Commit

Permalink
chore: don't authenticate & register on testing ✨ (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
meysam81 authored Nov 24, 2022
1 parent 1d17c16 commit 5602d76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions licenseware/app_builder/app_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,13 @@ def after_request(response):
if not self.reports:
log.warning("No reports provided")

self.authenticate_app()
if not envs.TESTING:
self.authenticate_app()
self.init_api()
self.init_routes()
self.init_namespaces()
self.init_broker()
if not envs.TESTING:
self.init_broker()
if register:
self.register_app()

Expand Down
2 changes: 2 additions & 0 deletions licenseware/common/constants/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ class envs:
PROMETHEUS_ENABLED: bool = os.getenv("PROMETHEUS_ENABLED", "").lower() == "true"
METRICS_URI: str = os.getenv("METRICS_URI", "/metrics")

TESTING: bool = os.getenv("TESTING", "").lower() == "true"

# Environment variables added later by the app
# envs.method_name() - calls the variable dynamically
# you can access class vars with cls.attr_name ex: cls.MONGO_COLLECTION_DATA_NAME
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
],
}

EXTRAS["all"] = list(set(sum(EXTRAS.values(), [])))

setup(
name="licenseware",
version=VERSION,
Expand Down

0 comments on commit 5602d76

Please sign in to comment.