Skip to content

Commit

Permalink
Merge pull request #71 from ggtools/patch-1
Browse files Browse the repository at this point in the history
Fix typo
  • Loading branch information
regebro committed Apr 7, 2015
2 parents 2ca3e8c + ee66c51 commit 42f267a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions hovercraft/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
CSS_RESOURCE, JS_RESOURCE, OTHER_RESOURCE = RESOURCE_TYPES

JS_POSITIONS = range(2)
JS_POSIION_HEADER, JS_POSIION_BODY = JS_POSITIONS
JS_POSITION_HEADER, JS_POSITION_BODY = JS_POSITIONS


class Resource(object):
Expand Down Expand Up @@ -96,12 +96,12 @@ def _load_template_files(self):
# JS files:
elif key == 'js-header':
for filename in files.split():
self.add_resource(filename, JS_RESOURCE, extra_info=JS_POSIION_HEADER,
self.add_resource(filename, JS_RESOURCE, extra_info=JS_POSITION_HEADER,
is_in_template=True)

elif key == 'js-body':
for filename in files.split():
self.add_resource(filename, JS_RESOURCE, extra_info=JS_POSIION_BODY,
self.add_resource(filename, JS_RESOURCE, extra_info=JS_POSITION_BODY,
is_in_template=True)

# Other files:
Expand Down
6 changes: 3 additions & 3 deletions hovercraft/tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from lxml import etree

from hovercraft.template import (Template, CSS_RESOURCE, JS_RESOURCE,
JS_POSIION_BODY, JS_POSIION_HEADER)
JS_POSITION_BODY, JS_POSITION_HEADER)

TEST_DATA = os.path.join(os.path.split(__file__)[0], 'test_data')

Expand Down Expand Up @@ -45,14 +45,14 @@ def test_template_maximal(self):

js_bodies = [each.filepath for each in template_info.resources if
each.resource_type == JS_RESOURCE and
each.extra_info == JS_POSIION_BODY]
each.extra_info == JS_POSITION_BODY]
self.assertIn('js/impress.js', js_bodies)
self.assertIn('js/impressConsole.js', js_bodies)
self.assertIn('js/hovercraft.js', js_bodies)

js_headers = [each.filepath for each in template_info.resources if
each.resource_type == JS_RESOURCE and
each.extra_info == JS_POSIION_HEADER]
each.extra_info == JS_POSITION_HEADER]
self.assertIn('js/dummy.js', js_headers)

self.assertEqual(template_info.resources[0].filepath, 'css/style.css')
Expand Down

0 comments on commit 42f267a

Please sign in to comment.