Merge "Remove get_repo_tag"
authorCedric Ollivier <cedric.ollivier@orange.com>
Mon, 11 Sep 2017 06:08:20 +0000 (06:08 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 11 Sep 2017 06:08:20 +0000 (06:08 +0000)
1  2 
functest/opnfv_tests/openstack/tempest/conf_utils.py
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.'