Skip to content

Commit d936fea

Browse files
authored
Merge pull request #140 from OpenDataAlex/process_tracker_python-100
Process tracker python 100
2 parents 8caafc0 + 45c6abe commit d936fea

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ after_success:
1414
before_script:
1515
- mkdir $HOME/.process_tracker
1616
- if [[ ! -z "$DB" ]]; then mv configs/${DB}_config.ini $HOME/.process_tracker/process_tracker_config.ini; fi
17+
- cp configs/process_tracker_config_dev.ini $HOME/.process_tracker/process_tracker_config_dev.ini
1718
- if [[ "$DB" == "postgres" ]]; then psql -f dbscripts/postgresql_account_create.sql -U postgres; fi
1819
- if [[ "$DB" == "postgres" ]]; then psql -f dbscripts/postgresql_process_tracker.sql process_tracker -U postgres; fi
1920
- if [[ "$DB" == "postgres" ]]; then psql -f dbscripts/postgresql_process_tracker_defaults.sql process_tracker -U postgres; fi
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[DEFAULT]
2+
log_level = ERROR
3+
max_concurrent_failures = 5
4+
data_store_type = postgresql
5+
data_store_username = pt_admin
6+
data_store_password = Testing1!
7+
data_store_host = localhost
8+
data_store_port = 5432
9+
data_store_name = process_tracker

process_tracker/utilities/settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def __init__(self, config_location=None):
4040
else:
4141
self.config_path = config_location
4242

43-
if "process_tracker_config.ini" not in self.config_path:
43+
if (
44+
"process_tracker_config.ini" not in self.config_path
45+
and ".ini" not in self.config_path
46+
):
4447
self.logger.debug(
4548
"process_tracker_config.ini not present. Appending to %s"
4649
% self.config_path

tests/utilities/test_settings_manager.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,21 @@ def test_config_location_set_with_file(self):
5656

5757
self.assertEqual(expected_result, given_result)
5858

59+
def test_config_location_set_with_ini_file(self):
60+
"""
61+
Testing that if an .ini file that is NOT named process_tracker_config.ini_in the config_location, it is accepted
62+
as the config file.
63+
:return:
64+
"""
65+
66+
expected_result = "/home/travis/.process_tracker/process_tracker_config_dev.ini"
67+
68+
given_result = SettingsManager(
69+
config_location="/home/travis/.process_tracker/process_tracker_config_dev.ini"
70+
).config_file
71+
72+
self.assertEqual(expected_result, given_result)
73+
5974
def test_config_location_s3(self):
6075
"""
6176
Testing that if config_location is set and the path is an s3 file/location, use that instead of the home

0 commit comments

Comments
 (0)