예제 #1
0
    def test_create_workbook(self, mock__create_workbook):
        mistral_scenario = workbooks.MistralWorkbooks()
        definition = "---\nversion: \"2.0\"\nname: wb"
        fake_wb = mock.MagicMock()
        fake_wb.name = "wb"
        mock__create_workbook.return_value = fake_wb
        mistral_scenario.create_workbook(definition)

        self.assertEqual(1, mock__create_workbook.called)
예제 #2
0
    def test_create_delete_workbook(self, mock__create_workbook,
                                    mock__delete_workbook):
        mistral_scenario = workbooks.MistralWorkbooks(self.context)
        definition = "---\nversion: \"2.0\"\nname: wb"
        fake_wb = mock.MagicMock()
        fake_wb.name = "wb"
        mock__create_workbook.return_value = fake_wb
        mistral_scenario.create_workbook(definition, do_delete=True)

        self.assertEqual(1, mock__create_workbook.called)
        mock__delete_workbook.assert_called_once_with(fake_wb.name)
예제 #3
0
 def test_list_workbooks(self, mock__list_workbooks):
     mistral_scenario = workbooks.MistralWorkbooks()
     mistral_scenario.list_workbooks()
     mock__list_workbooks.assert_called_once_with()