Ejemplo n.º 1
0
    def test_run_task_failures(self, m_ans_runner):
        m_result = m_ans_runner.run.return_value
        m_result.status = 'failed'
        self.assertRaises(exceptions.NetworkRunnerException, self.net_runr.run,
                          playbook.Playbook())

        m_result.status = ''
        m_result.stats = {'failures': ['I got some failure']}
        self.assertRaises(exceptions.NetworkRunnerException, self.net_runr.run,
                          playbook.Playbook())
Ejemplo n.º 2
0
    def test_run(self, m_ans_runner):
        m_result = m_ans_runner.run.return_value
        m_result.stats = {'failures': []}

        self.net_runr.run(playbook.Playbook())

        m_ans_runner.run.assert_called_once()