def test_atom(self): atom_entry = atom.Entry(id=uuid.uuid4().urn, title=atom.Text('text', 'Atom Entry Title'), updated=datetime.datetime.utcnow()) entry = atomrss.feed.AtomEntry(atom_entry) assert entry.title.format == 'text' assert entry.title.value == 'Atom Entry Title'
def test_atom_summary_html(self): atom_entry = atom.Entry(id=uuid.uuid4().urn, title=atom.Text('text', 'Atom Entry Title'), updated=datetime.datetime.utcnow(), summary=atom.Text('html', 'The summary of the entry.')) entry = atomrss.feed.AtomEntry(atom_entry) assert entry.content.format == 'html' assert entry.content.source is None assert entry.content.value == 'The summary of the entry.'
def test_atom_content_src(self): atom_entry = atom.Entry(id=uuid.uuid4().urn, title=atom.Text('text', 'Atom Entry Title'), updated=datetime.datetime.utcnow(), content=atom.Content('text/html', 'http://example.com', None)) entry = atomrss.feed.AtomEntry(atom_entry) assert entry.content.format == 'text/html' assert entry.content.source == 'http://example.com' assert entry.content.value is None
def test_atom_content_embedded_html(self): atom_entry = atom.Entry(id=uuid.uuid4().urn, title=atom.Text('text', 'Atom Entry Title'), updated=datetime.datetime.utcnow(), content=atom.Content( 'html', None, 'The content of the Atom entry.')) entry = atomrss.feed.AtomEntry(atom_entry) assert entry.content.format == 'html' assert entry.content.source is None assert entry.content.value == 'The content of the Atom entry.'
def test_atom(self): atom_entry = atom.Entry(id=uuid.uuid4().urn, title=atom.Text('text', 'Atom Entry Title'), updated=datetime.datetime.utcnow(), links=[ atom.Link(href='http://example.com', rel='alternate', type='text/html') ]) entry = atomrss.feed.AtomEntry(atom_entry) assert entry.website == atomrss.feed.Link(href='http://example.com', rel='alternate', type='text/html')
def test_atom_no_content(self): atom_entry = atom.Entry(id=uuid.uuid4().urn, title=atom.Text('text', 'Atom Entry Title'), updated=datetime.datetime.utcnow()) entry = atomrss.feed.AtomEntry(atom_entry) assert entry.content is None