Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML Validations for config.py #396

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ venv.bak/
# Mono Auto Generated Files
mono_crash.*

generated_cv
/generated_cv
data_folder/secrets.yaml
13 changes: 11 additions & 2 deletions app_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# LOGGING
# In this file, you can set the configurations of the app.

"""
MINIMUM_LOG_LEVEL can only be one of the followings:
- "DEBUG"
- "INFO"
- "WARNING"
- "ERROR"
- "CRITICAL"
"""
MINIMUM_LOG_LEVEL = "DEBUG"

MINIMUM_WAIT_TIME = 60 * 15
MINIMUM_WAIT_TIME = 60
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def validate_config(config_yaml_path: Path) -> dict:
'locations': list,
'distance': int,
'companyBlacklist': list,
'titleBlacklist': list
'titleBlacklist': list,
'llm_model_type': str,
'llm_model': str
}

for key, expected_type in required_keys.items():
Expand Down
12 changes: 0 additions & 12 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@

log_file = "app_log.log"

# TODO: REMOVE THE FOLLOWING BLOCK: No need as Loguru handles everything by default
# logging.basicConfig(
# level=logging.INFO,
# format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
# handlers=[
# logging.FileHandler(log_file, mode='a', encoding='utf-8'),
# logging.StreamHandler()
# ],
# force=True # This will reset the root logger's handlers and apply the new configuration
# )



if MINIMUM_LOG_LEVEL in ["DEBUG", "TRACE", "INFO", "WARNING", "ERROR", "CRITICAL"]:
logger.remove()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_linkedIn_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_apply_jobs_with_jobs(mocker, job_manager):
job_manager.apply_jobs()

# Assertions
assert job_manager.driver.find_elements.call_count == 1
assert job_manager.driver.find_elements.call_count == 3
# Called for each job element
assert job_manager.extract_job_information_from_tile.call_count == 2
# Called for each job element
Expand Down
Loading