diff options
author | Zuul <zuul@review.opendev.org> | 2023-04-14 17:30:54 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-04-14 17:30:54 +0000 |
commit | 8e875df65a3158aeb80318c77fd06662c0ed6d52 (patch) | |
tree | 04ded85c65421825ccdeac2b4f2063b278fef186 /test | |
parent | 5fae344ef4a253daa11a3e7603064df142143803 (diff) | |
parent | bbf9687b717be182ec90139e4fc132a58b6c0a7d (diff) | |
download | swift-8e875df65a3158aeb80318c77fd06662c0ed6d52.tar.gz |
Merge "InternalClient: error if allow_modify_pipeline is True"
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/common/test_internal_client.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/common/test_internal_client.py b/test/unit/common/test_internal_client.py index 1ccbf30f0..65bbed9a9 100644 --- a/test/unit/common/test_internal_client.py +++ b/test/unit/common/test_internal_client.py @@ -437,6 +437,27 @@ class TestInternalClient(unittest.TestCase): self.assertEqual(request_tries, client.request_tries) self.assertTrue(client.use_replication_network) + def test_init_allow_modify_pipeline(self): + conf_path = 'some_path' + app = FakeSwift() + user_agent = 'some_user_agent' + + with mock.patch.object( + internal_client, 'loadapp', return_value=app) as mock_loadapp,\ + self.assertRaises(ValueError) as cm: + internal_client.InternalClient( + conf_path, user_agent, 1, allow_modify_pipeline=True) + mock_loadapp.assert_not_called() + self.assertIn("'allow_modify_pipeline' is no longer supported", + str(cm.exception)) + + with mock.patch.object( + internal_client, 'loadapp', return_value=app) as mock_loadapp: + internal_client.InternalClient( + conf_path, user_agent, 1, allow_modify_pipeline=False) + mock_loadapp.assert_called_once_with( + conf_path, allow_modify_pipeline=False, global_conf=None) + def test_gatekeeper_not_loaded(self): app = FakeSwift() pipeline = [app] |