Exemple #1
0
 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'
Exemple #2
0
 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.'
Exemple #3
0
 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
Exemple #4
0
 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.'
Exemple #5
0
 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')
Exemple #6
0
 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