From: Cedric Ollivier Date: Mon, 11 Sep 2017 06:08:20 +0000 (+0000) Subject: Merge "Remove get_repo_tag" X-Git-Tag: 0.2~331 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=6dac04c5556db7fa2dc4088116b91509f4e73084;p=functest-xtesting.git Merge "Remove get_repo_tag" --- 6dac04c5556db7fa2dc4088116b91509f4e73084 diff --cc functest/tests/unit/openstack/tempest/test_conf_utils.py index 22017a7a,9df97b4c..50b0edc6 --- a/functest/tests/unit/openstack/tempest/test_conf_utils.py +++ b/functest/tests/unit/openstack/tempest/test_conf_utils.py @@@ -157,36 -157,11 +157,25 @@@ class OSTempestConfUtilsTesting(unittes self.assertTrue(m1.called) self.assertTrue(m2.called) - def test_get_repo_tag_default(self): - mock_popen = mock.Mock() - attrs = {'stdout.readline.return_value': 'test_tag'} - mock_popen.configure_mock(**attrs) - - with mock.patch('functest.opnfv_tests.openstack.tempest.' - 'conf_utils.subprocess.Popen', - return_value=mock_popen): - self.assertEqual(conf_utils.get_repo_tag('test_repo'), - 'test_tag') - def test_backup_tempest_config_default(self): with mock.patch('functest.opnfv_tests.openstack.tempest.' - 'conf_utils.shutil.copyfile') as m1: + 'conf_utils.os.path.exists', + return_value=False), \ + mock.patch('functest.opnfv_tests.openstack.tempest.' + 'conf_utils.os.makedirs') as m1, \ + mock.patch('functest.opnfv_tests.openstack.tempest.' + 'conf_utils.shutil.copyfile') as m2: conf_utils.backup_tempest_config('test_conf_file') self.assertTrue(m1.called) + self.assertTrue(m2.called) + + with mock.patch('functest.opnfv_tests.openstack.tempest.' + 'conf_utils.os.path.exists', + return_value=True), \ + mock.patch('functest.opnfv_tests.openstack.tempest.' + 'conf_utils.shutil.copyfile') as m2: + conf_utils.backup_tempest_config('test_conf_file') + self.assertTrue(m2.called) def test_configure_tempest_default(self): with mock.patch('functest.opnfv_tests.openstack.tempest.'