Skip to content

Commit

Permalink
Switch to dynamically pulling the version rather than hard coding it
Browse files Browse the repository at this point in the history
- suggestion originates from code review
  • Loading branch information
mpacer committed Jun 29, 2019
1 parent 8dbf4e1 commit 7f98456
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bookstore/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
from unittest.mock import Mock

from bookstore._version import __version__
from bookstore.handlers import collect_handlers, build_settings_dict, BookstoreVersionHandler
from bookstore.bookstore_config import BookstoreSettings, validate_bookstore
from bookstore.clone import BookstoreCloneHandler, BookstoreCloneAPIHandler
Expand All @@ -16,6 +17,7 @@
from traitlets.config import Config

log = logging.getLogger('test_handlers')
version = __version__

from traitlets.config import Config

Expand Down Expand Up @@ -90,13 +92,13 @@ def bookstore_settings(request):

def test_build_settings_dict(bookstore_settings):
expected = {
'version': '2.3.0.dev',
'validation': {
'archive_valid': True,
'bookstore_valid': True,
'publish_valid': True,
'cloning_valid': True,
},
'version': version,
}
validation = validate_bookstore(bookstore_settings)
assert expected == build_settings_dict(validation)
Expand Down Expand Up @@ -152,12 +154,12 @@ def test_build_response(self):
empty_handler = self.get_handler('/api/bookstore/')
expected = {
'bookstore': True,
'version': '2.3.0.dev',
'validation': {
'archive_valid': True,
'bookstore_valid': True,
'publish_valid': True,
'cloning_valid': True,
},
'version': version,
}
assert empty_handler.build_response_dict() == expected

0 comments on commit 7f98456

Please sign in to comment.