def test_do_list_categories_with_no_categories(self, mock_stdout, mock_db_catalog_api): mock_db_catalog_api.category_get_names.return_value = [] expected_output = "No categories were found" manage.do_list_categories() self.assertEqual(expected_output, mock_stdout.getvalue().replace('\n', ''))
def test_do_list_categories(self, mock_stdout): expected_output = ">> Murano package categories:* "\ "test_category_1* test_category_2" manage.do_list_categories() self.assertEqual( expected_output, mock_stdout.getvalue().replace('\n', '').replace('b\'', '').replace('\'', ''))