Skip to content

Commit

Permalink
adding API and todo to move main() to __main__
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Mar 12, 2018
1 parent 71702b8 commit 59b435e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
7 changes: 6 additions & 1 deletion random_wc_model_generator/__init__.py
Expand Up @@ -2,4 +2,9 @@

# read version
with open(pkg_resources.resource_filename('random_wc_model_generator', 'VERSION'), 'r') as file:
__version__ = file.read().strip()
__version__ = file.read().strip()

# API
from .core import CreateWcLangModel, GenerateModel
from . import enrich_polymers
from . import random_polymer
1 change: 1 addition & 0 deletions random_wc_model_generator/core.py
Expand Up @@ -142,6 +142,7 @@ def run(self):
self.summarize_generated_model(wc_lang_model)
return self

# todo: move to __main__.py
def main(test_args=None):
if test_args is None:
args = GenerateModel.parse_command_line() # pragma: no cover
Expand Down
18 changes: 18 additions & 0 deletions tests/test_api.py
@@ -0,0 +1,18 @@
""" Tests API
:Author: Jonathan Karr <jonrkarr@gmail.com>
:Date: 2018-03-12
:Copyright: 2018, Karr Lab
:License: MIT
"""

import random_wc_model_generator
import types
import unittest


class ApiTestCase(unittest.TestCase):
def test(self):
self.assertIsInstance(random_wc_model_generator, types.ModuleType)
self.assertIsInstance(random_wc_model_generator.CreateWcLangModel, type)
self.assertIsInstance(random_wc_model_generator.enrich_polymers, types.ModuleType)

0 comments on commit 59b435e

Please sign in to comment.