Add history_link markdown basic test case

This commit is contained in:
guerler
2021-04-19 21:43:20 -04:00
parent 2516c4da94
commit a10b3a2fab
@@ -22,6 +22,12 @@ class BaseExportTestCase(BaseTestCase):
self.app.history_manager = mock.MagicMock()
self.app.dataset_collections_service = mock.MagicMock()
def _new_history(self):
history = model.History()
history.id = 1
history.name = "New History"
return history
def _new_hda(self, contents=None):
hda = model.HistoryDatasetAssociation()
hda.id = 1
@@ -39,6 +45,12 @@ class BaseExportTestCase(BaseTestCase):
invocation.create_time = now()
return invocation
@contextmanager
def _expect_get_history(self, history):
self.app.history_manager.get_accessible.return_value = history
yield
self.app.history_manager.get_accessible.assert_called_once_with(history.id, self.trans.user)
@contextmanager
def _expect_get_hda(self, hda, hda_id=1):
self.app.hda_manager.get_accessible.return_value = hda
@@ -128,6 +140,17 @@ history_dataset_peek(history_dataset_id=1)
result = self._to_basic(example)
assert '\n*No Dataset Peek Available*\n' in result
def test_history_link(self):
history = self._new_history()
example = """# Example
```galaxy
history_link(history_id=1)
```
"""
with self._expect_get_history(history):
result = self._to_basic(example)
assert '\n New History\n\n' in result
def test_history_display_binary(self):
hda = self._new_hda()
hda.extension = 'ab1'