diff --git a/doc/source/admin/conda_faq.rst b/doc/source/admin/conda_faq.rst index e2e5af12fa2..a4fc5a0221c 100644 --- a/doc/source/admin/conda_faq.rst +++ b/doc/source/admin/conda_faq.rst @@ -54,7 +54,7 @@ time it starts up and be configured to use it by default. The long answer is that Galaxy's tool dependency resolution is managed via ``dependency_resolvers_conf.xml`` configuration file. This configuration -file is discussed in detail in the :ref:`Dependency Resolvers ` +file is discussed in detail in the :doc:`Dependency Resolvers ` documentation. Most Galaxy administrators will be using Galaxy's default dependency resolvers configuration file (``config/dependency_resolvers_conf.xml.sample``). With release 16.04, Galaxy has enabled Conda dependency resolution by default when @@ -68,7 +68,7 @@ entry should remain first. This means that tools that have specified Tool Shed p as their dependencies will work without a change. The most common configuration settings related to Conda are listed in Table 1. -See `galaxy.yml.sample`_ for the complete list. +See :doc:`Configuration Options ` for the complete list. +-------------------------+------------------------------------+---------------------------+ | Setting | Default setting | Meaning | @@ -105,7 +105,7 @@ handle these dependencies for you, but admins are not required to use Galaxy for dependency management. There are a few config options in the ``galaxy.yml`` file (see Table 1 or -`galaxy.yml.sample`_ for more information), but by default Galaxy will install +:doc:`Configuration Options ` for more information), but by default Galaxy will install Conda (the package manager) and the required packages in the ``/_conda/`` directory. In this directory, Galaxy will create an ``envs`` folder with all of the environments managed by Galaxy. Each @@ -203,7 +203,7 @@ The order in which resolvers are tried is listed in the - Conda packages The first system that satisfies a requirement will be used. See -`resolver docs`_ for detailed documentation. +:doc:`Dependency Resolvers ` for detailed documentation. This however is not recommended, ideally tools will target and test against Conda for all dependencies. Also resolving all requirements @@ -408,13 +408,11 @@ The command can obviously be adapted to install any version of Conda. .. _Conda quick-start: https://conda.io/docs/user-guide/getting-started.html .. _ansible role: https://github.com/galaxyproject/ansible-galaxy-tools .. _BioBlend: https://github.com/galaxyproject/bioblend -.. _resolver docs: https://docs.galaxyproject.org/en/master/admin/dependency_resolvers.html .. _Conda channels: https://conda.io/docs/user-guide/tasks/manage-channels.html .. _create a Conda package: https://conda.io/docs/user-guide/tasks/build-packages/recipe.html .. _submit: https://bioconda.github.io/#step-4-join-the-team .. _BioConda: https://bioconda.github.io .. _contact with the IUC: https://gitter.im/galaxy-iuc/iuc -.. _galaxy.yml.sample: https://docs.galaxyproject.org/en/master/admin/options.html .. _Pull Request #3106: https://github.com/galaxyproject/galaxy/pull/3106 .. _Pull Request #3348: https://github.com/galaxyproject/galaxy/pull/3348 .. _Pull Request #3391: https://github.com/galaxyproject/galaxy/pull/3391 diff --git a/doc/source/admin/special_topics/bug_reports.rst b/doc/source/admin/special_topics/bug_reports.rst index e58b36e3f88..11200edc405 100644 --- a/doc/source/admin/special_topics/bug_reports.rst +++ b/doc/source/admin/special_topics/bug_reports.rst @@ -10,7 +10,7 @@ single configuration file, ``config/error_report.yml.sample``. Let's look at that briefly: -.. code-block:: yml +.. code-block:: yaml - type: email verbose: true diff --git a/doc/source/admin/special_topics/webhooks.rst b/doc/source/admin/special_topics/webhooks.rst index 51404cd2971..7a81a5809cc 100644 --- a/doc/source/admin/special_topics/webhooks.rst +++ b/doc/source/admin/special_topics/webhooks.rst @@ -45,23 +45,26 @@ For each type there is an example provided: - Additional functionality can be added to the top menu. Two dummy buttons are implemented to show the idea: - A button that links to biostars - .. image:: images_webhooks/masthead.png - :scale: 50 % + + .. image:: images_webhooks/masthead.png + :scale: 50 % - A button that shows a pop-up with information about an user. - .. image:: images_webhooks/masthead_trans_object.png - :scale: 50 % + + .. image:: images_webhooks/masthead_trans_object.png + :scale: 50 % - The history menu can be extended. In this case we use two dummy entries 'History Menu Webhook Item 1' and 'History Menu Webhook Item 2'. - .. image:: images_webhooks/history-menu.png - :scale: 25 % + + .. image:: images_webhooks/history-menu.png + :scale: 25 % Plugin structure ---------------- Each plugin has the following folder structure: -.. code-block:: +.. code-block:: yaml - plugin_name - config.yml (mandatory) diff --git a/doc/source/conf.py b/doc/source/conf.py index 9217bed763d..49173724736 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -17,14 +17,9 @@ import sys import sphinx_rtd_theme # Library to make .md to slideshow -from recommonmark.parser import CommonMarkParser from recommonmark.transform import AutoStructify -source_parsers = { - '.md': CommonMarkParser, -} - -# Set GALAXY_DOCS_SKIP_SOURCE=1 to skip building source and release information and +# Set GALAXY_DOCS_SKIP_SOURCE=1 to skip building source information and # just build primary documentation. (Quicker to debug issues in most frequently updated # docs). SKIP_SOURCE = os.environ.get("GALAXY_DOCS_SKIP_SOURCE", False) == "1" @@ -45,7 +40,7 @@ sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pa # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] +extensions = ['recommonmark', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] if not SKIP_SOURCE: extensions += ['sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode'] @@ -108,10 +103,9 @@ release = VERSION # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. +exclude_patterns = ['**/_*.rst'] if SKIP_SOURCE: - exclude_patterns = ['lib', 'releases'] -else: - exclude_patterns = [] + exclude_patterns.extend(['lib']) # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None diff --git a/doc/source/dev/index.rst b/doc/source/dev/index.rst index c6648a05ad6..31137edb366 100644 --- a/doc/source/dev/index.rst +++ b/doc/source/dev/index.rst @@ -1,5 +1,5 @@ Development Documentation -======================= +========================= .. toctree:: :maxdepth: 1 diff --git a/doc/source/releases/16.07_announce.rst b/doc/source/releases/16.07_announce.rst index acde41b5be1..f6c8dfb773c 100644 --- a/doc/source/releases/16.07_announce.rst +++ b/doc/source/releases/16.07_announce.rst @@ -12,7 +12,7 @@ Highlights Galaxy admins obtained the ability to install Galaxy tool's dependencies using the Conda package manager. This is a Beta feature and we encourage interested deployers to opt-in by modifying configuration. - Documentation that explains this switch and answers FAQ is `available `__. + Documentation that explains this switch and answers FAQ is :doc:`available <../admin/conda_faq>`. **Dynamic tool destinations** Our friends from Canada National Microbiology Laboratory enhanced @@ -24,7 +24,7 @@ Highlights **Galaxy chat** Admins can now plug in the included communication server to enable users of their instance to use real-time chat within the Galaxy interface. - Please see the `documentation `__ + Please see the :doc:`documentation <../admin/special_topics/chat>` to learn how to activate and use this feature. Implemented in `PR #2515 `__ diff --git a/doc/source/releases/16.10.rst b/doc/source/releases/16.10.rst index aff9ed39d11..14fbd984870 100644 --- a/doc/source/releases/16.10.rst +++ b/doc/source/releases/16.10.rst @@ -18,7 +18,7 @@ Highlighted Enhancements * Implement a collection operation tool for merging collections (thanks to `@Takadonet `__). `Pull Request 2771`_ -* Replace `reference documentation `__ +* Replace :doc:`reference documentation <../dev/schema>` for tool XML files with automatically generated documentation from a now official Galaxy XSD documentation (with help from many). `Pull Request 2923`_, `Pull Request 2936`_, `Pull Request 3086`_, diff --git a/doc/source/releases/16.10_announce.rst b/doc/source/releases/16.10_announce.rst index 49ce02e21b6..33ccbb0e700 100644 --- a/doc/source/releases/16.10_announce.rst +++ b/doc/source/releases/16.10_announce.rst @@ -9,7 +9,7 @@ Highlights ========== **Galaxu UI plugins - Webhooks** - We introduce Galaxy Webhooks - optional plugins for the web UI that allow for better customization of your instance. See the `documentation `__. + We introduce Galaxy Webhooks - optional plugins for the web UI that allow for better customization of your instance. See the :doc:`documentation <../admin/special_topics/webhooks>`. Includes work from `@bgruening `__, `@anatskiy `__, and Joachim Wolff `@joachimwolff `__. Implemented in `Pull Request 3040`_. diff --git a/doc/source/releases/17.01_announce.rst b/doc/source/releases/17.01_announce.rst index 6abf8ac34ee..d5d3eead805 100644 --- a/doc/source/releases/17.01_announce.rst +++ b/doc/source/releases/17.01_announce.rst @@ -14,7 +14,7 @@ Highlights such as `BioConda `__. Such channels are already being used for new and updated tools by IUC and we suggest adopting this tool dependency resolution method to all tool developers instead of Tool Shed package recipes - which are now considered deprecated. - Please see the details at the admin `documentation `__ + Please see the details at the admin :doc:`documentation <../admin/conda_faq>`. **New interface for user preferences** User preferences menu has been reworked for clarity and consistency. @@ -27,7 +27,7 @@ Highlights or ``fastqsanger.bz2`` for compressed files). Existing tools will work as before and future tools will be able to consume archives and save space in your quota. Thanks to `@abretaud `__, `@ashvark `__, `@jvolkening `__, and `@mvdbeek `__. - Implemented in `Pull Request 3145`_, `PullRequest 3510`_ and `PullRequest 3514`_. + Implemented in `Pull Request 3145`_, `Pull Request 3510`_ and `Pull Request 3514`_. Get Galaxy ========== diff --git a/doc/source/releases/18.01.rst b/doc/source/releases/18.01.rst index cd507ddc8d2..f9bd8a0145e 100644 --- a/doc/source/releases/18.01.rst +++ b/doc/source/releases/18.01.rst @@ -111,6 +111,7 @@ Enhancements * Add Phylip datatype (thanks to `@khillion `__). `Pull Request 5301`_ + .. enhancement * Option to group Galaxy Tours for viewing clarity diff --git a/lib/galaxy/dependencies/pipfiles/default/Pipfile b/lib/galaxy/dependencies/pipfiles/default/Pipfile index 29414b29d87..a96bdf7bf0b 100644 --- a/lib/galaxy/dependencies/pipfiles/default/Pipfile +++ b/lib/galaxy/dependencies/pipfiles/default/Pipfile @@ -36,7 +36,7 @@ Mercurial = {version = "<=3.7.3", markers = "python_version < '3'"} nodeenv = "*" pycryptodome = "*" uWSGI = "*" -pysam = "==0.15.1" +pysam = "==0.15.2" bdbag = "==1.4.1" # 1.5.0 requires Python >=2.7.9 bleach = "*" "bz2file" = {version = "*", markers = "python_version < '3.3'"} diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt index 4d68d12801c..61a8641ceff 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-dev-requirements.txt @@ -7,34 +7,35 @@ attrs==18.2.0 babel==2.6.0 certifi==2018.11.29 chardet==3.0.4 -commonmark==0.5.4 +commonmark==0.8.1 docutils==0.14 funcsigs==1.0.2 ; python_version < '3.3' +future==0.17.1 gunicorn==19.9.0 -idna==2.7 +idna==2.8 imagesize==1.1.0 jinja2==2.10 -lxml==4.2.5 +lxml==4.3.0 markupsafe==1.1.0 mock==2.0.0 -more-itertools==4.3.0 +more-itertools==5.0.0 nose==1.3.7 nosehtml==0.4.5 pathlib2==2.3.3 ; python_version < '3.6' pathtools==0.1.2 pbr==5.1.1 -pluggy==0.8.0 +pluggy==0.8.1 py==1.7.0 pygithub3==0.5.1 ; python_version < '3' -pygments==2.3.0 +pygments==2.3.1 pytest-html==1.19.0 -pytest-metadata==1.7.0 +pytest-metadata==1.8.0 pytest-pythonpath==0.7.3 -pytest==4.0.1 -pytz==2018.7 +pytest==4.1.0 +pytz==2018.9 pyyaml==3.13 -recommonmark==0.4.0 -requests==2.20.1 +recommonmark==0.5.0 +requests==2.21.0 scandir==1.9.0 ; python_version < '3.5' selenium==3.141.0 six==1.11.0 @@ -42,7 +43,7 @@ snowballstemmer==1.2.1 sphinx-rtd-theme==0.4.2 sphinx==1.6.7 sphinxcontrib-websupport==1.1.0 -testfixtures==6.3.0 +testfixtures==6.4.3 twill==0.9.1 ; python_version < '3' typing==3.6.6 ; python_version < '3.5' urllib3==1.24.1 diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt index b4ae3fc1e29..b91ba098a00 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt @@ -19,11 +19,11 @@ azure-storage-common==1.4.0 azure-storage-nspkg==3.1.0 babel==2.6.0 bagit==1.6.4 -bcrypt==3.1.4 +bcrypt==3.1.5 bdbag==1.4.1 beaker==1.10.0 -bioblend==0.11.0 -bleach==3.0.2 +bioblend==0.12.0 +bleach==3.1.0 boltons==18.0.1 boto3==1.7.84 boto==2.49.0 @@ -48,7 +48,7 @@ deprecation==2.0.6 dictobj==0.4 docopt==0.6.2 docutils==0.14 -dogpile.cache==0.6.8 +dogpile.cache==0.7.1 enum34==1.1.6 ; python_version < '3.4' fabric3==1.14.post1 funcsigs==1.0.2 ; python_version < '3.3' @@ -57,8 +57,8 @@ future==0.17.1 futures==3.2.0 ; python_version == '2.6' or python_version == '2.7' galaxy-sequence-utils==1.1.3 gxformat2==0.8.0 -h5py==2.8.0 -idna==2.7 +h5py==2.9.0 +idna==2.8 ipaddress==1.0.22 ; python_version < '3.3' isa-rwval==0.10.7 iso8601==0.1.12 @@ -67,8 +67,8 @@ jmespath==0.9.3 jsonpatch==1.23 jsonpointer==2.0 jsonschema==2.6.0 -keystoneauth1==3.11.1 -kombu==4.2.1 +keystoneauth1==3.11.2 +kombu==4.2.2.post1 mako==1.0.7 markupsafe==1.1.0 mercurial==3.7.3 ; python_version < '3' @@ -78,7 +78,7 @@ msrest==0.5.5 msrestazure==0.5.0 munch==2.3.2 netaddr==0.7.19 -netifaces==0.10.7 +netifaces==0.10.9 networkx==1.11 nodeenv==1.3.3 nose==1.3.7 @@ -87,36 +87,36 @@ oauthlib==2.1.0 openstacksdk==0.17.0 os-client-config==1.31.2 os-service-types==1.4.0 -osc-lib==1.11.1 +osc-lib==1.12.0 oslo.config==6.7.0 oslo.context==2.22.0 oslo.i18n==3.23.0 -oslo.log==3.42.0 +oslo.log==3.42.2 oslo.serialization==2.28.1 -oslo.utils==3.38.0 +oslo.utils==3.39.1 packaging==18.0 paramiko==2.4.2 parsley==1.3 -paste==3.0.5 +paste==3.0.6 pastedeploy==2.0.1 pastescript==3.0.0 pbr==5.1.1 prettytable==0.7.2 psutil==5.4.8 pulsar-galaxy-lib==0.8.3 -pyasn1==0.4.4 +pyasn1==0.4.5 pycparser==2.19 pycryptodome==3.7.2 pycryptodomex==3.7.2 pyinotify==0.9.6 ; sys_platform != 'win32' and sys_platform != 'darwin' and sys_platform != 'sunos5' pyjwkest==1.4.0 -pyjwt==1.7.0 +pyjwt==1.7.1 pykwalify==1.7.0 pynacl==1.3.0 pyopenssl==18.0.0 pyparsing==2.3.0 pyperclip==1.7.0 -pysam==0.15.1 +pysam==0.15.2 pysftp==0.2.9 python-cinderclient==4.0.0 python-dateutil==2.7.5 @@ -127,12 +127,12 @@ python-neutronclient==6.9.0 python-novaclient==11.0.0 python-openid==2.2.5 python-swiftclient==3.6.0 -pytz==2018.7 +pytz==2018.9 pyyaml==3.13 repoze.lru==0.7 -requests-oauthlib==1.0.0 +requests-oauthlib==1.1.0 requests-toolbelt==0.8.0 -requests==2.20.1 +requests==2.21.0 requestsexceptions==1.4.0 rfc3986==1.2.0 routes==2.4.1 @@ -141,8 +141,8 @@ simplejson==3.16.0 six==1.11.0 social-auth-core[openidconnect]==1.5.0 sqlalchemy-migrate==0.11.0 -sqlalchemy-utils==0.33.9 -sqlalchemy==1.2.14 +sqlalchemy-utils==0.33.10 +sqlalchemy==1.2.16 sqlparse==0.2.4 stevedore==1.30.0 subprocess32==3.5.3 ; python_version < '3.0' @@ -154,10 +154,10 @@ tzlocal==1.5.1 unicodecsv==0.14.1 ; python_version < '3.0' urllib3==1.24.1 uwsgi==2.0.17.1 -vine==1.1.4 +vine==1.2.0 warlock==1.3.0 wcwidth==0.1.7 ; sys_platform != 'win32' webencodings==0.5.1 -webob==1.8.4 +webob==1.8.5 whoosh==2.7.4 -wrapt==1.10.11 +wrapt==1.11.0 diff --git a/lib/galaxy/web/framework/base.py b/lib/galaxy/web/framework/base.py index b2ef292deb1..7f08994f20c 100644 --- a/lib/galaxy/web/framework/base.py +++ b/lib/galaxy/web/framework/base.py @@ -499,12 +499,12 @@ def send_file(start_response, trans, body): return body -def iterate_file(file): +def iterate_file(fh): """ Progressively return chunks from `file`. """ while 1: - chunk = file.read(CHUNK_SIZE) + chunk = fh.read(CHUNK_SIZE) if not chunk: break yield chunk diff --git a/lib/galaxy/webapps/galaxy/api/datasets.py b/lib/galaxy/webapps/galaxy/api/datasets.py index 666960d3adf..23173121b18 100644 --- a/lib/galaxy/webapps/galaxy/api/datasets.py +++ b/lib/galaxy/webapps/galaxy/api/datasets.py @@ -351,23 +351,23 @@ class DatasetsController(BaseAPIController, UsesVisualizationMixin): else: file_path = hda.file_name rval = open(file_path, 'rb') - else: display_kwd = kwd.copy() if 'key' in display_kwd: del display_kwd["key"] rval = hda.datatype.display_data(trans, hda, preview, filename, to_ext, **display_kwd) - - except Exception as exception: - log.error("Error getting display data for dataset (%s) from history (%s): %s", - history_content_id, history_id, str(exception), exc_info=True) + except Exception as e: + log.exception("Error getting display data for dataset (%s) from history (%s)", + history_content_id, history_id) trans.response.status = 500 - rval = ("Could not get display data for dataset: " + str(exception)) - + rval = "Could not get display data for dataset: %s" % e return rval @web.expose_api_raw_anonymous def get_metadata_file(self, trans, history_content_id, history_id, metadata_file=None, **kwd): + """ + GET /api/histories/{history_id}/contents/{history_content_id}/metadata_file + """ decoded_content_id = self.decode_id(history_content_id) rval = '' try: @@ -376,12 +376,12 @@ class DatasetsController(BaseAPIController, UsesVisualizationMixin): fname = ''.join(c in util.FILENAME_VALID_CHARS and c or '_' for c in hda.name)[0:150] trans.response.headers["Content-Type"] = "application/octet-stream" trans.response.headers["Content-Disposition"] = 'attachment; filename="Galaxy%s-[%s].%s"' % (hda.hid, fname, file_ext) - return open(hda.metadata.get(metadata_file).file_name) - except Exception as exception: - log.error("Error getting metadata_file (%s) for dataset (%s) from history (%s): %s", - metadata_file, history_content_id, history_id, str(exception), exc_info=True) + return open(hda.metadata.get(metadata_file).file_name, 'rb') + except Exception as e: + log.exception("Error getting metadata_file (%s) for dataset (%s) from history (%s)", + metadata_file, history_content_id, history_id) trans.response.status = 500 - rval = ("Could not get display data for dataset: " + str(exception)) + rval = "Could not get metadata for dataset: %s" % e return rval @web._future_expose_api_anonymous diff --git a/lib/galaxy/webhooks/__init__.py b/lib/galaxy/webhooks/__init__.py index e32ee2d9ba6..e5d32fdc7d4 100644 --- a/lib/galaxy/webhooks/__init__.py +++ b/lib/galaxy/webhooks/__init__.py @@ -1,6 +1,7 @@ """ This module manages loading of Galaxy webhooks. """ +import io import logging import os @@ -64,8 +65,8 @@ class WebhooksRegistry(object): log.exception(e) def load_webhook_from_config(self, webhook_dir, config_file_path): - with open(config_file_path) as file: - config = yaml.safe_load(file) + with open(config_file_path) as fh: + config = yaml.safe_load(fh) weight = config.get('weight', 1) if weight < 1: @@ -83,8 +84,8 @@ class WebhooksRegistry(object): # single file try: styles_file = os.path.join(webhook_dir, 'styles.css') - with open(styles_file, 'r') as file: - webhook.styles = file.read().replace('\n', '') + with open(styles_file, 'r') as fh: + webhook.styles = fh.read().replace('\n', '') except IOError: pass @@ -92,8 +93,8 @@ class WebhooksRegistry(object): # single file try: script_file = os.path.join(webhook_dir, 'script.js') - with open(script_file, 'r') as file: - webhook.script = file.read() + with io.open(script_file, 'r', encoding='utf-8') as fh: + webhook.script = fh.read() except IOError: pass diff --git a/test/api/test_galaxy_interactor.py b/test/api/test_galaxy_interactor.py index f3458e08f3b..e6084b7364e 100644 --- a/test/api/test_galaxy_interactor.py +++ b/test/api/test_galaxy_interactor.py @@ -10,4 +10,4 @@ class GalaxyInteractorBackwardCompatTestCase(api.ApiTestCase): def test_local_test_data_download(self): self.galaxy_interactor._target_galaxy_version = Version("18.09") assert self.galaxy_interactor.supports_test_data_download is False - assert self.galaxy_interactor.test_data_download(tool_id='cat1', filename='1.bed').readline().startswith('chr1\t147962192\t147962580') + assert self.galaxy_interactor.test_data_download(tool_id='cat1', filename='1.bed').readline().startswith(b'chr1\t147962192\t147962580') diff --git a/test/api/test_histories.py b/test/api/test_histories.py index 8766807ec9c..bf135b03504 100644 --- a/test/api/test_histories.py +++ b/test/api/test_histories.py @@ -192,7 +192,7 @@ class HistoriesApiTestCase(api.ApiTestCase): def test_import_metadata_regeneration(self): history_name = "for_import_metadata_regeneration" history_id = self.dataset_populator.new_history(name=history_name) - self.dataset_populator.new_dataset(history_id, content=open(self.test_data_resolver.get_filename("1.bam")), file_type='bam') + self.dataset_populator.new_dataset(history_id, content=open(self.test_data_resolver.get_filename("1.bam"), 'rb'), file_type='bam') imported_history_id = self._reimport_history(history_id, history_name) self._assert_history_length(imported_history_id, 1) import_bam_metadata = self.dataset_populator.get_history_dataset_details( @@ -203,7 +203,7 @@ class HistoriesApiTestCase(api.ApiTestCase): assert bai_metadata["file_type"] == "bam_index" api_url = bai_metadata["download_url"].split("api/", 1)[1] bai_response = self._get(api_url) - assert bai_response.status_code == 200 + self._assert_status_code_is(bai_response, 200) assert len(bai_response.content) > 4 def test_import_export_collection(self):