Exemplo n.º 1
0
    def test_special_cases(self):
        feed = Feed('samruby', 'http://www.intertwingly.net/blog/index.atom')
        shutil.copy(
            pkg_resources.resource_filename(__name__, 'fixture/samruby.xml'),
            self.tmpdir)
        entries = feed.parse()

        self.assertEquals(
            0,
            entries[0].resolved_link.find('http://www.intertwingly.net/blog'))
Exemplo n.º 2
0
    def test_parse_entries(self):
        feed = Feed('ongoing', 'http://www.tbray.org/ongoing/ongoing.atom')
        shutil.copy(
            pkg_resources.resource_filename(__name__, 'fixture/ongoing.xml'),
            self.tmpdir)
        entries = feed.parse()

        self.assertEquals('Tim Bray', feed.author)
        self.assertEquals(20, len(entries))
        self.assertEquals('Moose Camp', entries[0].title)

        msg = entries[0].to_mail()
        subject = decode_header(msg['Subject'])[0]
        self.assertEquals('Moose Camp', subject[0].decode(subject[1]
                                                          or 'ascii'))
        self.assertEquals('Tim Bray <rsspull@localhost>', msg['From'])