Models: Random fixes for mapping tests.

PEP-8. Get rid of old test suite code mixed into real code.
This commit is contained in:
John Chilton
2013-12-05 00:20:54 -06:00
parent 79c8f59341
commit 9faa65a66e
2 changed files with 4 additions and 8 deletions
-5
View File
@@ -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 )
+4 -3
View File
@@ -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" ) )