Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ python:
- '3.4'
install:
- pip install -e .
- pip install coverage coveralls wheel
- pip install coverage coveralls flake8 wheel
script:
- flake8
- coverage run setup.py test
- coveralls
- coverage report --fail-under=100
Expand Down
3 changes: 2 additions & 1 deletion pyembed/mustache/test/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import vcr


@vcr.use_cassette('pyembed/mustache/test/fixtures/cassettes/embed_template.yml')
@vcr.use_cassette(
'pyembed/mustache/test/fixtures/cassettes/embed_template.yml')
def test_should_embed_with_mustache_template():
renderer = MustacheRenderer('pyembed/mustache/test/fixtures')
embedding = PyEmbed(renderer=renderer).embed(
Expand Down
27 changes: 17 additions & 10 deletions pyembed/mustache/test/mustache_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def test_default_embed_photo():

oembed_response = response.OEmbedPhotoResponse(
create_value_function(values))
assert MustacheRenderer('.').render('http://example.com', oembed_response) == \
renderer = MustacheRenderer('.')
assert renderer.render('http://example.com', oembed_response) == \
'<img src="http://example.com/bees.jpg" width="300" height="200" />'


Expand All @@ -46,7 +47,9 @@ def test_default_embed_video():

oembed_response = response.OEmbedVideoResponse(
create_value_function(values))
assert MustacheRenderer('.').render('http://example.com', oembed_response) == embedding
assert MustacheRenderer('.').render(
'http://example.com',
oembed_response) == embedding


def test_default_embed_rich():
Expand All @@ -57,7 +60,9 @@ def test_default_embed_rich():

oembed_response = response.OEmbedRichResponse(
create_value_function(values))
assert MustacheRenderer('.').render('http://example.com', oembed_response) == embedding
assert MustacheRenderer('.').render(
'http://example.com',
oembed_response) == embedding


def test_default_embed_link():
Expand All @@ -66,16 +71,18 @@ def test_default_embed_link():

oembed_response = response.OEmbedLinkResponse(
create_value_function(values))
assert MustacheRenderer('.').render('http://example.com', oembed_response) == \
'<a href="http://example.com">Bees!</a>'
assert MustacheRenderer('.').render(
'http://example.com',
oembed_response) == '<a href="http://example.com">Bees!</a>'


def test_should_embed_with_template():
values = {'type': 'video',
'version': '1.0',
'html': '<iframe src="http://www.example.com/bees.mpg"></iframe>',
'title': 'Bees',
'author_name': 'Ian Bees'}
values = {
'type': 'video',
'version': '1.0',
'html': '<iframe src="http://www.example.com/bees.mpg"></iframe>',
'title': 'Bees',
'author_name': 'Ian Bees'}

oembed_response = response.OEmbedVideoResponse(
create_value_function(values))
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def run_tests(self):
author='Matt Thomson',
author_email='mattjohnthomson@gmail.com',
url='http://pyembed.github.io',
description='PyEmbed plugin for rendering embeddings using Mustache templates',
description='PyEmbed plugin for rendering embeddings using Mustache ' +
'templates',
long_description=open('README.rst').read() + '\n\n' +
open('CHANGES.rst').read(),
download_url='https://pypi.python.org/pypi/pyembed-mustache/',
Expand Down