diff --git a/db_facts/db_config.py b/db_facts/db_config.py index 9ffd5ad..9a7509f 100644 --- a/db_facts/db_config.py +++ b/db_facts/db_config.py @@ -3,7 +3,7 @@ def db_config(dbcli_config: DBCLIConfig, db_name: DBName) -> Optional[DBConfig]: - dbs = dbcli_config['dbs'] + dbs = dbcli_config.get('dbs', {}) config_name = "-".join(db_name) diff --git a/metrics/bigfiles_high_water_mark b/metrics/bigfiles_high_water_mark index d1e85f8..f59a90f 100644 --- a/metrics/bigfiles_high_water_mark +++ b/metrics/bigfiles_high_water_mark @@ -1 +1 @@ -326 +337 diff --git a/metrics/coverage_high_water_mark b/metrics/coverage_high_water_mark index 1711da9..6e3fec5 100644 --- a/metrics/coverage_high_water_mark +++ b/metrics/coverage_high_water_mark @@ -1 +1 @@ -97.9100 \ No newline at end of file +97.9200 \ No newline at end of file diff --git a/metrics/mypy_high_water_mark b/metrics/mypy_high_water_mark index 38f037c..a9c9114 100644 --- a/metrics/mypy_high_water_mark +++ b/metrics/mypy_high_water_mark @@ -1 +1 @@ -72.6500 \ No newline at end of file +72.7300 \ No newline at end of file diff --git a/setup.py b/setup.py index f063d27..bd7e575 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ import sys -VERSION = '3.0.1' +VERSION = '3.0.2' # From https://circleci.com/blog/continuously-deploying-python-packages-to-pypi-with-circleci/ diff --git a/tests/test_db_info.py b/tests/test_db_info.py index bb35b5c..00db931 100644 --- a/tests/test_db_info.py +++ b/tests/test_db_info.py @@ -1,3 +1,4 @@ +import db_facts from db_facts.db_info import db import unittest from unittest.mock import patch @@ -79,3 +80,13 @@ def test_db_info_two_level_with_one_level_config(self, assert_called_with(['frazzle', 'mumble'], mock_dbcli_config['dbs']['frazzle'], mock_dbcli_config) + + def test_db_info_empty_config(self, + mock_lpass_field, + mock_db_info_from_lpass, + mock_pull_jinja_context): + mock_pull_jinja_context.return_value = ({}, {}) + with self.assertRaises(db_facts.errors.UserErrorException) as e: + db(['frazzle', 'mumble'], dbcli_config={}) + self.assertTrue('frazzle-mumble is not a valid DB name' in str(e.exception), + str(e.exception))