Skip to content

Commit

Permalink
Merge pull request #17584 from nsoranzo/release_23.2_fix_test_page_en…
Browse files Browse the repository at this point in the history
…coding

[23.2] Fix ``test_page_encoding`` and ``test_collection_explicit_and_implicit`` integration tests
  • Loading branch information
jdavcs authored Mar 4, 2024
2 parents de1bb85 + 241fc3b commit ac9a6b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions test/integration/test_page_revision_json_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
exported API values are encoded though.
"""

import re

from sqlalchemy import select

from galaxy import model
Expand All @@ -21,6 +23,7 @@ def setUp(self):
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)

def test_page_encoding(self, history_id: str):
history_num_re = re.compile(r'id="History-\d+"')
request = dict(
slug="mypage",
title="MY PAGE",
Expand All @@ -30,13 +33,13 @@ def test_page_encoding(self, history_id: str):
api_asserts.assert_status_code_is_ok(page_response)
sa_session = self._app.model.session
page_revision = sa_session.scalars(select(model.PageRevision).filter_by(content_format="html")).all()[0]
assert '''id="History-1"''' in page_revision.content, page_revision.content
assert history_num_re.search(page_revision.content), page_revision.content
assert f'''id="History-{history_id}"''' not in page_revision.content, page_revision.content

show_page_response = self._get("pages/{}".format(page_response.json()["id"]))
api_asserts.assert_status_code_is_ok(show_page_response)
content = show_page_response.json()["content"]
assert '''id="History-1"''' not in content, content
assert not history_num_re.search(content), content
assert f'''id="History-{history_id}"''' in content, content

def test_page_encoding_markdown(self, history_id: str):
Expand Down
2 changes: 1 addition & 1 deletion test/integration/test_workflow_scheduling_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_collection_explicit_and_implicit(self):
inputs = {
"0": {"src": "hdca", "id": hdca1["id"]},
}
self.workflow_populator.invoke_workflow_and_wait(history_id, workflow_id, inputs)
self.workflow_populator.invoke_workflow_and_wait(workflow_id, history_id, inputs)
self.dataset_populator.wait_for_history(history_id, assert_ok=True)
assert "a\nc\nb\nd\ne\ng\nf\nh\n" == self.dataset_populator.get_history_dataset_content(history_id, hid=0)

Expand Down

0 comments on commit ac9a6b4

Please sign in to comment.