Make Marathon and Chronos tests more deterministic

The --force value is overriden on tests which check force mode.
Unfortunately, when the test written for non-force mode is
running after the force mode, the old config override is still
remaining. This commit ensures that for non-force mode, the
--force flag is disabled.

Change-Id: I045c9e7ea05a54f82ea4a1f58b03625e84df0489
Closes-Bug: 1526340
This commit is contained in:
Michal Rostecki 2015-12-15 15:23:00 +01:00
parent e695cf5999
commit 979f830ea1
2 changed files with 2 additions and 0 deletions

View File

@ -73,6 +73,7 @@ class TestClient(base.BaseTestCase):
@mock.patch.object(chronos, 'LOG')
@requests_mock.mock()
def test_add_job_already_existing(self, log_mock, req_mock):
CONF.set_override('force', False)
req_mock.get('http://localhost:4400/scheduler/jobs', json=[{
'name': '/keystone-bootstrap'
}])

View File

@ -53,6 +53,7 @@ class TestMarathonClient(base.BaseTestCase):
@mock.patch.object(marathon, 'LOG')
def test_add_app_already_existing(self, log_mock):
CONF.set_override('force', False)
with mock.patch.object(
self.client, 'get_app', return_value={'id': 'my-app',
'other_param': 'the-old-one'}