From f614b345be46201147c3be47aa0933234e45f1df Mon Sep 17 00:00:00 2001 From: Adam Kijak Date: Thu, 19 Jan 2017 11:44:28 +0000 Subject: [PATCH] An unit test passes because is launched as non-root user This change fixes the issue by setting filesystem_store_datadir and filesystem_store_datadirs to None (missing values). Closes-Bug: 1657710 Change-Id: Ida5bee9682e24befd63bd2b4b2107ee84eac1a1b --- glance_store/tests/unit/test_store_base.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glance_store/tests/unit/test_store_base.py b/glance_store/tests/unit/test_store_base.py index 5917220b..6a33d0bd 100644 --- a/glance_store/tests/unit/test_store_base.py +++ b/glance_store/tests/unit/test_store_base.py @@ -29,6 +29,12 @@ class TestStoreBase(base.StoreBaseTest): @mock.patch.object(store.driver, 'LOG') def test_configure_does_not_raise_on_missing_driver_conf(self, mock_log): self.config(stores=['file'], group='glance_store') + self.config(filesystem_store_datadir=None, group='glance_store') + self.config(filesystem_store_datadirs=None, group='glance_store') for (__, store_instance) in backend._load_stores(self.conf): store_instance.configure() - self.assertTrue(mock_log.warning.called) + mock_log.warning.assert_called_once_with( + "Failed to configure store correctly: Store filesystem " + "could not be configured correctly. Reason: Specify " + "at least 'filesystem_store_datadir' or " + "'filesystem_store_datadirs' option Disabling add method.")