示例#1
0
    def test_all(self):
        memacs = RssMemacs(argv=self.argv.split())
        data = memacs.test_get_entries()

        self.assertEqual(
            data[0],
            (
                "** <2009-09-06 Sun 16:45> "
                "[[http://www.wikipedia.org/][Example entry]]"
            )
        )
        self.assertEqual(
            data[1],
            "   Here is some text containing an interesting description."
        )
        self.assertEqual(
            data[3],
            "   :GUID:       unique string per item")
        self.assertEqual(
            data[4],
            '   :PUBLISHED:  Mon, 06 Sep 2009 16:45:00 +0000'
        )
        self.assertEqual(
            data[5],
            "   :ID:         a0df7d405a7e9822fdd86af04e162663f1dccf11"
        )

        self.assertEqual(data[2], "   :PROPERTIES:")
        self.assertEqual(data[6], "   :END:")
示例#2
0
文件: rss_test.py 项目: novoid/Memacs
    def test_all(self):
        memacs = RssMemacs(argv=self.argv.split())
        data = memacs.test_get_entries()

        # omit the hour from the result because this depends on the current locals:
        self.assertTrue(data[0].startswith('** <2009-09-06 Sun '))
        self.assertTrue(data[0].endswith(':45> [[http://www.wikipedia.org/][Example entry]]'))

        self.assertEqual(
            data[2],
            "   :GUID:       unique string per item")
        self.assertEqual(
            data[3],
            '   :PUBLISHED:  Mon, 06 Sep 2009 16:45:00 +0000'
        )
        self.assertEqual(
            data[4],
            "   :ID:         a0df7d405a7e9822fdd86af04e162663f1dccf11"
        )
        self.assertEqual(
            data[6],
            "   Here is some text containing an interesting description."
        )

        self.assertEqual(data[1], "   :PROPERTIES:")
        self.assertEqual(data[5], "   :END:")
示例#3
0
def main():
    global memacs
    memacs = RssMemacs(prog_version=PROG_VERSION_NUMBER,
                       prog_version_date=PROG_VERSION_DATE,
                       prog_description=PROG_DESCRIPTION,
                       prog_short_description=PROG_SHORT_DESCRIPTION,
                       prog_tag=PROG_TAG,
                       copyright_year=COPYRIGHT_YEAR,
                       copyright_authors=COPYRIGHT_AUTHORS)
    memacs.handle_main()
示例#4
0
    def test_all(self):
        memacs = RssMemacs(argv=self.argv.split())
        data = memacs.test_get_entries()

        self.assertEqual(data[0],
                         ("** <2009-09-06 Sun 16:45> "
                          "[[http://www.wikipedia.org/][Example entry]]"))
        self.assertEqual(
            data[1],
            "   Here is some text containing an interesting description.")
        self.assertEqual(data[3], "   :GUID:       unique string per item")
        self.assertEqual(data[4],
                         '   :PUBLISHED:  Mon, 06 Sep 2009 16:45:00 +0000')
        self.assertEqual(
            data[5],
            "   :ID:         a0df7d405a7e9822fdd86af04e162663f1dccf11")

        self.assertEqual(data[2], "   :PROPERTIES:")
        self.assertEqual(data[6], "   :END:")
示例#5
0
    def test_all(self):
        memacs = RssMemacs(argv=self.argv.split())
        data = memacs.test_get_entries()

        # generate assertEquals :)
        #for d in range(len(data)):
        #    print "self.assertEqual(\n\tdata[%d],\n\t\"%s\")" % \
        #        (d, data[d])
        self.assertEqual(
            data[0],
            "** <2009-09-06 Sun 16:45> [[http://www.wikipedia.or" + \
            "g/][Example entry]]")
        self.assertEqual(
            data[1],
            "   Here is some text containing an interesting description.")
        self.assertEqual(data[2], "   :PROPERTIES:")
        self.assertEqual(data[3], "   :GUID:       unique string per item")
        self.assertEqual(
            data[4],
            "   :ID:         7ec7b2ec7d1ac5f18188352551b04f061af81e04")
        self.assertEqual(data[5], "   :END:")
示例#6
0
    def test_all(self):
        memacs = RssMemacs(argv=self.argv.split())
        data = memacs.test_get_entries()

        # omit the hour from the result because this depends on the current locals:
        self.assertTrue(data[0].startswith('** <2009-09-06 Sun '))
        self.assertTrue(data[0].endswith(
            ':45> [[http://www.wikipedia.org/][Example entry]]'))

        self.assertEqual(data[2], "   :GUID:       unique string per item")
        self.assertEqual(data[3],
                         '   :PUBLISHED:  Mon, 06 Sep 2009 16:45:00 +0000')
        self.assertEqual(
            data[4],
            "   :ID:         a0df7d405a7e9822fdd86af04e162663f1dccf11")
        self.assertEqual(
            data[6],
            "   Here is some text containing an interesting description.")

        self.assertEqual(data[1], "   :PROPERTIES:")
        self.assertEqual(data[5], "   :END:")
示例#7
0
 def test_false_appending(self):
     try:
         memacs = RssMemacs(argv=self.argv.split())
         memacs.test_get_entries()
     except Exception:
         pass
示例#8
0

Attention: RSS2.0 is required

Sample Org-entries
: ** <2009-09-06 Sun 18:45> [[http://www.wikipedia.org/][link]]: Example entry
:   Here is some text containing an interesting description.
:   :PROPERTIES:
:   :LINK:    [[http://www.wikipedia.org/]]
:   :GUID:    rss guid
:   :SUMMARY: Here is some text containing an interesting description.
:   :ID:      unique string per item
:   :END:
"""
COPYRIGHT_YEAR = "2011-2013"
COPYRIGHT_AUTHORS = """Karl Voit <*****@*****.**>,
Armin Wieser <*****@*****.**>"""


if __name__ == "__main__":
    memacs = RssMemacs(
        prog_version=PROG_VERSION_NUMBER,
        prog_version_date=PROG_VERSION_DATE,
        prog_description=PROG_DESCRIPTION,
        prog_short_description=PROG_SHORT_DESCRIPTION,
        prog_tag=PROG_TAG,
        copyright_year=COPYRIGHT_YEAR,
        copyright_authors=COPYRIGHT_AUTHORS
        )
    memacs.handle_main()
示例#9
0
 def test_false_appending(self):
     try:
         memacs = RssMemacs(argv=self.argv.split())
         memacs.test_get_entries()
     except Exception:
         pass