@@ -23,45 +23,53 @@ def _base(self):
2323
2424
2525class ManagerMissingPathway (ManagerMissingFunctions ):
26- """Test ComPath manager for abstract class ."""
26+ """A bad implementation of a manager that is missing the pathway model ."""
2727
2828 def get_pathway_by_id (self , pathway_id ):
29- pass
29+ """Get a pathway by its database identifier."""
3030
3131 def get_pathway_names_to_ids (self ):
32- pass
32+ """Get a dictionary from pathway names to their identifiers."""
3333
3434 def populate (self , * args , ** kwargs ):
35- pass
35+ """Populate the database."""
3636
3737 def query_gene_set (self , gene_set ):
38- pass
38+ """Find pathways with genes in the given set."""
3939
4040
4141class ManagerMissingProtein (ManagerMissingPathway ):
42+ """A bad implementation of a manager that is missing the protein model."""
4243 pathway_model = object ()
4344
4445
4546class ManagerOkay (ManagerMissingProtein ):
47+ """An example of a good implementation of a manager."""
4648 protein_model = object ()
4749
4850
4951class TestManagerFailures (unittest .TestCase ):
50- """Tests bad implementations of the manager"""
52+ """Tests bad implementations of the manager. """
5153
5254 def test_abstract_methods (self ):
55+ """Test a TypeError is thrown when required functions aren't implemented."""
5356 with self .assertRaises (TypeError ):
5457 ManagerMissingFunctions ()
5558
5659 def test_pathway_model_error (self ):
60+ """Test an error is thrown when the pathway model is not defined."""
5761 with self .assertRaises (CompathManagerPathwayModelError ):
5862 ManagerMissingPathway ()
5963
6064 def test_protein_model_error (self ):
65+ """Tests an error is thrown when the protein model is not defined."""
6166 with self .assertRaises (CompathManagerProteinModelError ):
6267 ManagerMissingProtein ()
6368
6469
6570class TestManager (TemporaryConnectionMethodMixin ):
71+ """Tests for good managers."""
72+
6673 def test_instantiation (self ):
74+ """Test that a good implementation of the manager can be instantiated."""
6775 ManagerOkay (connection = self .connection )
0 commit comments