Skip to content

Commit

Permalink
Merge pull request #396 from tapas-joshi/v3
Browse files Browse the repository at this point in the history
YAML Validations for config.py
  • Loading branch information
feder-cr authored Sep 17, 2024
2 parents 225e5b9 + b841416 commit 46c0df9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
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

0 comments on commit 46c0df9

Please sign in to comment.