Skip to content

Commit

Permalink
#150: Add configuration options required for repo's tests
Browse files Browse the repository at this point in the history
- This commit also adds getters in config.py
  • Loading branch information
MRichards99 committed Nov 10, 2020
1 parent 257082e commit 57fcd68
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"debug_mode": false,
"generate_swagger": false,
"host": "127.0.0.1",
"port": "5000"
"port": "5000",
"test_username": "root",
"test_password": "pw",
"test_mechanism": "simple"
}
18 changes: 18 additions & 0 deletions datagateway_api/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@ def get_port(self):
except KeyError:
sys.exit("Missing config value, port")

def get_test_username(self):
try:
return self.config["test_username"]
except KeyError:
sys.exit("Missing config value, test_username")

def get_test_password(self):
try:
return self.config["test_password"]
except KeyError:
sys.exit("Missing config value, test_password")

def get_test_mechanism(self):
try:
return self.config["test_mechanism"]
except KeyError:
sys.exit("Missing config value, test_mechanism")

def get_icat_properties(self):
"""
ICAT properties can be retrieved using Python ICAT's client object, however this
Expand Down

0 comments on commit 57fcd68

Please sign in to comment.