Example #1
0
 def setup(self):
     """Initialize test"""
     time = datetime(2014, 1, 29, 12, 13, 14)
     self.default_sect = _ChangelogSection(RpmPkgPolicy, time, name="J. D.",
                                           email="u@h", revision="1")
     entry = _ChangelogEntry(RpmPkgPolicy, "J. D.", "- my change")
     self.default_sect.entries = [entry]
Example #2
0
 def test_append_entry(self):
     """Test add_entry() method"""
     section = self.default_sect
     entry = _ChangelogEntry(RpmPkgPolicy, author="",
                             text="- another\n  change")
     new_entry = section.append_entry(entry)
     eq_(str(section), "* Wed Jan 29 2014 J. D. <u@h> 1\n- my change\n"
                       "- another\n  change\n\n")
     eq_(new_entry, section.entries[-1])
Example #3
0
 def test_str_format(self):
     """Basic test"""
     entry = _ChangelogEntry(RpmPkgPolicy,
                             author="John Doe",
                             text="- foo\n  bar")
     eq_(str(entry), "- foo\n  bar\n")
Example #4
0
 def test_str_format(self):
     """Basic test"""
     entry = _ChangelogEntry(RpmPkgPolicy, author="John Doe",
                             text="- foo\n  bar")
     eq_(str(entry), "- foo\n  bar\n")