Skip to content

Commit

Permalink
unit test fix #7 [test_localization_disable.py]
Browse files Browse the repository at this point in the history
  • Loading branch information
MothScientist committed Jan 10, 2025
1 parent 2af6c0e commit 4bf0325
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions budget_graph/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from budget_graph.global_config import GlobalConfig

logger_dict = setup_logger('logs/DictLog.log', 'dict_loger')
localization_enable: bool = GlobalConfig.localization_enable # create a link to the var for convenience


class Emoji:
Expand Down Expand Up @@ -56,7 +55,7 @@ def receive_translation(language: str, phrase: str) -> str:
return 'Error'

# if localization is disabled - the default language is English
dict_language_obj: dict = get_translate_from_json(language if localization_enable else 'en')
dict_language_obj: dict = get_translate_from_json(language if GlobalConfig.localization_enable else 'en')

return str(dict_language_obj.get(phrase, 'Error'))

Expand Down
2 changes: 0 additions & 2 deletions budget_graph/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ def set_config():
GlobalConfig.localization_enable = (
GlobalConfig.localization_enable or conf_data.get('localization').get('localization_enable')
)

print(GlobalConfig.localization_enable)
3 changes: 1 addition & 2 deletions budget_graph/time_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
from budget_graph.global_config import GlobalConfig

logger_time = setup_logger("logs/TimeLog.log", "time_logger")
timeit_enable: bool = GlobalConfig.timeit_enable # create a link to the var for convenience


def timeit(func):
@wraps(func)
def wrapper(*args, **kwargs):

if not timeit_enable:
if not GlobalConfig.timeit_enable:
return func(*args, **kwargs)

_start = perf_counter()
Expand Down

0 comments on commit 4bf0325

Please sign in to comment.