Skip to content
This repository was archived by the owner on Mar 16, 2020. It is now read-only.

Commit 5075022

Browse files
committed
Update documentation
1 parent 254d7a3 commit 5075022

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22

3+
"""Setup.py for ComPath Utilities"""
4+
35
import codecs
46
import os
57
import re
@@ -40,7 +42,7 @@ def read(*parts):
4042

4143

4244
def find_meta(meta):
43-
"""Extract __*meta*__ from META_FILE"""
45+
"""Extract __*meta*__ from META_FILE."""
4446
meta_match = re.search(
4547
r'^__{meta}__ = ["\']([^"\']*)["\']'.format(meta=meta),
4648
META_FILE, re.M

tests/test_manager.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,53 @@ def _base(self):
2323

2424

2525
class 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

4141
class ManagerMissingProtein(ManagerMissingPathway):
42+
"""A bad implementation of a manager that is missing the protein model."""
4243
pathway_model = object()
4344

4445

4546
class ManagerOkay(ManagerMissingProtein):
47+
"""An example of a good implementation of a manager."""
4648
protein_model = object()
4749

4850

4951
class 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

6570
class 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)

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ deps =
5858
pep8-naming
5959
flake8-colors
6060
commands =
61-
flake8 src/bio2bel/ tests/ setup.py
61+
flake8 src/compath_utils/ tests/ setup.py
6262

6363

6464
[flake8]
@@ -86,7 +86,7 @@ deps =
8686
pyflakes
8787
pylint
8888
commands =
89-
pylint src/bio2bel
89+
pylint src/compath_utils
9090

9191
[testenv:doc8]
9292
basepython = python3

0 commit comments

Comments
 (0)