Skip to content

Commit

Permalink
add __version__ to the botstory module
Browse files Browse the repository at this point in the history
  • Loading branch information
hyzhak committed May 16, 2017
1 parent c2f8ed4 commit 1d2782f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions botstory/__init__.py
Original file line number Diff line number Diff line change
@@ -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()
7 changes: 7 additions & 0 deletions botstory/story_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 1d2782f

Please sign in to comment.