diff --git a/botstory/__init__.py b/botstory/__init__.py index d61a21b..6c6aafc 100644 --- a/botstory/__init__.py +++ b/botstory/__init__.py @@ -1,5 +1,9 @@ from .ast.callable import EndOfStory from .ast.forking import SwitchOnValue, Undefined from .story import Story +import os __all__ = [EndOfStory, Story, SwitchOnValue] + +with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'version.txt')) as version_file: + __version__ = version_file.read().strip() diff --git a/botstory/story_test.py b/botstory/story_test.py index c3af20b..23bc97f 100644 --- a/botstory/story_test.py +++ b/botstory/story_test.py @@ -3,14 +3,21 @@ import pytest from unittest.mock import call +import botstory from . import di from .integrations import mockdb, mockhttp from .middlewares import location, text from .utils import answer, SimpleTrigger +import os logger = logging.getLogger(__name__) +def test_botstory_has_current_version_of_module(): + with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'version.txt')) as version_file: + assert botstory.__version__ == version_file.read().strip() + + @pytest.mark.asyncio async def test_should_run_sequence_of_parts(): trigger_1 = SimpleTrigger()