From 5ddc4934d4072527d2c1a3b3f11565a8cc58f4ef Mon Sep 17 00:00:00 2001 From: John Chilton Date: Wed, 6 May 2015 11:34:31 -0400 Subject: [PATCH] Fix some doctests that were assuming fixed Python hashing. Tests are more correct and perhaps less strong as result. --- lib/galaxy/tools/parameters/basic.py | 8 ++++++-- lib/galaxy/tools/parameters/input_translation.py | 6 ++++-- lib/galaxy/util/__init__.py | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index d5061972ad8..03cbcc31dcb 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -1376,8 +1376,12 @@ class DrillDownSelectToolParameter( SelectToolParameter ): Option 5 - >>> print p.options - [{'selected': False, 'name': 'Heading 1', 'value': 'heading1', 'options': [{'selected': False, 'name': 'Option 1', 'value': 'option1', 'options': []}, {'selected': False, 'name': 'Option 2', 'value': 'option2', 'options': []}, {'selected': False, 'name': 'Heading 1', 'value': 'heading1', 'options': [{'selected': False, 'name': 'Option 3', 'value': 'option3', 'options': []}, {'selected': False, 'name': 'Option 4', 'value': 'option4', 'options': []}]}]}, {'selected': False, 'name': 'Option 5', 'value': 'option5', 'options': []}] + >>> print sorted(p.options[1].items()) + [('name', 'Option 5'), ('options', []), ('selected', False), ('value', 'option5')] + >>> p.options[0]["name"] + 'Heading 1' + >>> p.options[0]["selected"] + False """ def __init__( self, tool, input_source, context=None ): input_source = ensure_input_source( input_source ) diff --git a/lib/galaxy/tools/parameters/input_translation.py b/lib/galaxy/tools/parameters/input_translation.py index 3dd34c7e7ca..9f7d464be95 100644 --- a/lib/galaxy/tools/parameters/input_translation.py +++ b/lib/galaxy/tools/parameters/input_translation.py @@ -42,8 +42,10 @@ class ToolInputTranslator( object ): ... ''' ) ) >>> params = Params( { 'db':'hg17', 'URL':'URL_value', 'org':'Human', 'hgta_outputType':'primaryTable' } ) >>> translator.translate( params ) - >>> print params - {'hgta_outputType': 'primaryTable', 'data_type': 'tabular', 'table': 'unknown table', 'URL': 'URL_value?GALAXY_URL=0&_export=1', 'org': 'Human', 'URL_method': 'post', 'db': 'hg17', 'organism': 'Human', 'dbkey': 'hg17', 'description': 'no description'} + >>> print sorted(list(params.__dict__.keys())) + ['URL', 'URL_method', 'data_type', 'db', 'dbkey', 'description', 'hgta_outputType', 'org', 'organism', 'table'] + >>> params.get('URL', None) in ['URL_value?GALAXY_URL=0&_export=1', 'URL_value?_export=1&GALAXY_URL=0'] + True """ @classmethod def from_element( cls, elem ): diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index af27083a2ec..39f84532aee 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -631,8 +631,8 @@ class Params( object ): 0 >>> par.symbols # replaces unknown symbols with X ['alpha', '__lt____gt__', 'XrmX__pd__!'] - >>> par.flatten() # flattening to a list - [('status', 'on'), ('symbols', 'alpha'), ('symbols', '__lt____gt__'), ('symbols', 'XrmX__pd__!')] + >>> sorted(par.flatten()) # flattening to a list + [('status', 'on'), ('symbols', 'XrmX__pd__!'), ('symbols', '__lt____gt__'), ('symbols', 'alpha')] """ # is NEVER_SANITIZE required now that sanitizing for tool parameters can be controlled on a per parameter basis and occurs via InputValueWrappers?