From 9faa65a66ed28a5390d28fc05cbd604da21e9f70 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 5 Dec 2013 00:20:54 -0600 Subject: [PATCH] Models: Random fixes for mapping tests. PEP-8. Get rid of old test suite code mixed into real code. --- lib/galaxy/model/mapping.py | 5 ----- test/unit/test_galaxy_mapping.py | 7 ++++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py index 42ad22e8533..78662839a2a 100644 --- a/lib/galaxy/model/mapping.py +++ b/lib/galaxy/model/mapping.py @@ -2017,8 +2017,3 @@ def init( file_path, url, engine_options={}, create_tables=False, database_query #load local galaxy security policy result.security_agent = GalaxyRBACAgent( result ) return result - -def get_suite(): - """Get unittest suite for this module""" - import unittest, mapping_tests - return unittest.makeSuite( mapping_tests.MappingTests ) diff --git a/test/unit/test_galaxy_mapping.py b/test/unit/test_galaxy_mapping.py index 951da3b4c47..8c8fac09f56 100644 --- a/test/unit/test_galaxy_mapping.py +++ b/test/unit/test_galaxy_mapping.py @@ -1,7 +1,6 @@ import unittest import galaxy.model.mapping as mapping -from galaxy.model import directory_hash_id -import os.path + class MappingTests( unittest.TestCase ): def test_basic( self ): @@ -17,7 +16,8 @@ class MappingTests( unittest.TestCase ): h2 = model.History( name=( "H" * 1024 ) ) model.session.add_all( ( u, h1, h2 ) ) #q1 = model.Query( "h2->q1" ) - d1 = model.HistoryDatasetAssociation( extension="interval", metadata=dict(chromCol=1,startCol=2,endCol=3 ), history=h2, create_dataset=True, sa_session=model.session ) + metadata = dict( chromCol=1, startCol=2, endCol=3 ) + d1 = model.HistoryDatasetAssociation( extension="interval", metadata=metadata, history=h2, create_dataset=True, sa_session=model.session ) #h2.queries.append( q1 ) #h2.queries.append( model.Query( "h2->q2" ) ) model.session.add( ( d1 ) ) @@ -48,6 +48,7 @@ class MappingTests( unittest.TestCase ): assert hists[1].name == "History 2b" # gvk TODO need to ad test for GalaxySessions, but not yet sure what they should look like. + def get_suite(): suite = unittest.TestSuite() suite.addTest( MappingTests( "test_basic" ) )