<s> import pytest <EOL> import vcr <EOL> from pyembed . core import PyEmbed <EOL> from pyembed . core . render import PyEmbedRenderer <EOL> class DummyRenderer ( PyEmbedRenderer ) : <EOL> def render ( self , content_url , response ) : <EOL> return "<STR_LIT>" % ( response . title , response . author_name , content_url ) <EOL> @ vcr . use_cassette ( '<STR_LIT>' ) <EOL> def test_should_get_correct_embedding ( ) : <EOL> embedding = PyEmbed ( ) . embed ( <EOL> '<STR_LIT>' ) <EOL> assert '<STR_LIT>' in embedding <EOL> @ vcr . use_cassette ( '<STR_LIT>' ) <EOL> def test_should_get_another_correct_embedding ( ) : <EOL> embedding = PyEmbed ( ) . embed ( <EOL> '<STR_LIT>' ) <EOL> assert '<STR_LIT>' in embedding <EOL> @ vcr . use_cassette ( '<STR_LIT>' ) <EOL> def test_should_embed_with_maximum_height ( ) : <EOL> embedding = PyEmbed ( ) . embed ( <EOL> '<STR_LIT>' , max_height = <NUM_LIT:200> ) <EOL> assert '<STR_LIT>' in embedding <EOL> @ vcr . use_cassette ( '<STR_LIT>' ) <EOL> def test_should_embed_with_custom_renderer ( ) : <EOL> embedding = PyEmbed ( renderer = DummyRenderer ( ) ) . embed ( <EOL> '<STR_LIT>' ) <EOL> assert embedding == '<STR_LIT>' + '<STR_LIT>' <EOL> @ vcr . use_cassette ( '<STR_LIT>' ) <EOL> def test_should_embed_when_no_discovery ( ) : <EOL> embedding = PyEmbed ( ) . embed ( <EOL> '<STR_LIT>' ) <EOL> assert '<STR_LIT>' in embedding <EOL> @ vcr . use_cassette ( '<STR_LIT>' ) <EOL> def test_should_embed_when_text_xml_returned ( ) : <EOL> embedding = PyEmbed ( ) . embed ( '<STR_LIT>' ) <EOL> assert '<STR_LIT>' in embedding </s>
