Example #1
0
    def test_ID(self):
        c = Commit()
        c.add_header("author Armin Wieser <armin.wieser" + \
                     "@example.com> 1324422878 +0100")
        c.add_body("i'm the subject")
        c.add_body("i'm in the body")

        output, properties, note, author, timestamp = c.get_output()
        self.assertEqual(output, "Armin Wieser: i'm the subject")
        self.assertEqual(note, "i'm in the body\n")
        self.assertEqual(author, "Armin Wieser")
        self.assertEqual(timestamp, "<2011-12-21 Wed 00:14>")

        #for p in unicode(properties).splitlines():
        #    print "\"" + p + "\\n\""
        p = "   :PROPERTIES:\n"
        p += "   :AUTHOR:     Armin Wieser <[email protected]> " + \
        "1324422878 +0100\n"
        p += "   :ID:         2bcf0df19183b508b7d52e38ee1d811aabd207f5\n"
        p += "   :END:"

        self.assertEqual(str(properties), p)
Example #2
0
 def test_ID_empty(self):
     c = Commit()
     self.assertTrue(c.is_empty())