diff --git a/onamazu/onamazu.py b/onamazu/onamazu.py index 12330c2..1e0962a 100644 --- a/onamazu/onamazu.py +++ b/onamazu/onamazu.py @@ -22,7 +22,7 @@ def __load_config(self): self.logger.info(f'config_map={config_map}') if len(config_map) == 0: - raise Exception("No config file found. Please see README.md") + self.logger.warning(f"No config files ({config.ConfigFileName}) are found. Please see README.md") return config_map diff --git a/tests/test_reload_conf.py b/tests/test_reload_conf.py index 1a61c54..866551b 100644 --- a/tests/test_reload_conf.py +++ b/tests/test_reload_conf.py @@ -8,6 +8,15 @@ from onamazu.watcher import NamazuEvent +def test_return_empty_when_no_config_file(): + o = ONamazu(ct.ROOT_DIR, 60) + o.event_handler = MagicMock(name="event_handler") + o.click() + o.stop() + + o.event_handler.assert_not_called() + + class TestReload: def test_reload_on_create(self): ct.place_config_file("", {"pattern": "*.csv"})