コード例 #1
0
    def test_execute_fail(self, _, __):
        with self.assertRaises(errors.CheckBeforeDeploymentError) as cm:
            CheckRepositoryConnectionFromMasterNodeTask.execute(self.task)

        self.assertEqual(
            cm.exception.message,
            'Connection to following repositories could not be established: '
            '<url1 [500]>')
コード例 #2
0
    def test_execute_fail(self, get_mock):
        response_mock = mock.Mock()
        response_mock.status_code = 500
        response_mock.url = self.url
        get_mock.return_value = response_mock

        with self.assertRaises(errors.CheckBeforeDeploymentError):
            CheckRepositoryConnectionFromMasterNodeTask.execute(self.task)
コード例 #3
0
    def test_execute_success(self, get_mock):
        response_mock = mock.Mock()
        response_mock.status_code = 200
        response_mock.url = self.url
        get_mock.return_value = response_mock

        CheckRepositoryConnectionFromMasterNodeTask.execute(self.task)
        self.mrepos.assert_called_with(self.task.cluster)
    def test_execute_fail(self, _, __):
        with self.assertRaises(errors.CheckBeforeDeploymentError) as cm:
            CheckRepositoryConnectionFromMasterNodeTask.execute(self.task)

        self.assertEqual(
            cm.exception.message,
            'Connection to following repositories could not be established: '
            '<url1 [500]>')
コード例 #5
0
    def test_execute_fail_with_connection_error(self, m_exception, _, __):
        with self.assertRaises(errors.CheckBeforeDeploymentError) as cm:
            CheckRepositoryConnectionFromMasterNodeTask.execute(self.task)

        m_exception.assert_called_once_with(
            "Connection to the repositories could not be established: %s.",
            self._connection_error)

        self.assertEqual(
            cm.exception.message,
            "Connection to the repositories could not be "
            "established. Please refer to the Fuel Master "
            "web backend logs for more details.")
コード例 #6
0
 def test_execute_success_on_retry(self, _, __):
     CheckRepositoryConnectionFromMasterNodeTask.execute(self.task)
     self.mrepos.assert_called_with(self.task.cluster)
 def test_execute_success_on_retry(self, _, __):
     CheckRepositoryConnectionFromMasterNodeTask.execute(self.task)
     self.mrepos.assert_called_with(self.task.cluster)