Beispiel #1
0
 def release_line_bugfix_specifier(self):
     b50 = b(50)
     b42 = b(42, spec='1.1+')
     f25 = f(25)
     b35 = b(35)
     b34 = b(34)
     f22 = f(22)
     b20 = b(20)
     c = changelog2dict(releases(
         '1.2.1', '1.1.2', '1.0.3',
         b50, b42,
         '1.2.0', '1.1.1', '1.0.2',
         f25, b35, b34,
         '1.1.0', '1.0.1',
         f22, b20
     ))
     for rel, issues in (
         ('1.0.1', [b20]),
         ('1.1.0', [f22]),
         ('1.0.2', [b34, b35]),
         ('1.1.1', [b34, b35]),
         ('1.2.0', [f25]),
         ('1.0.3', [b50]), # the crux - is not b50 + b42
         ('1.1.2', [b50, b42]),
         ('1.2.1', [b50, b42]),
     ):
         eq_(set(c[rel]), set(issues))
Beispiel #2
0
 def unmarked_bullet_list_items_treated_as_bugs(self):
     fake = list_item('', paragraph('', '', raw('', 'whatever')))
     changelog = releases('1.0.2', self.f, fake)
     entries = changelog[1]['entries']
     eq_(len(entries), 1)
     assert self.f not in entries
     assert isinstance(entries[0], Issue)
     eq_(entries[0].number, None)
Beispiel #3
0
 def _expect_entries(self, all_entries, in_, not_in):
     # Grab 2nd release as 1st is the empty 'beginning of time' one
     entries = releases(*all_entries)[1]['entries']
     eq_(len(entries), len(in_))
     for x in in_:
         assert x in entries
     for x in not_in:
         assert x not in entries
Beispiel #4
0
 def oddly_ordered_bugfix_releases_and_unreleased_list(self):
     # Release set up w/ non-contiguous feature+bugfix releases; catches
     # funky problems with 'unreleased' buckets
     b2 = b(2)
     f3 = f(3)
     changelog = releases('1.1.1', '1.0.2', self.f, b2, '1.1.0', f3, self.b)
     assert f3 in changelog[1]['entries']
     assert b2 in changelog[2]['entries']
     assert b2 in changelog[3]['entries']
Beispiel #5
0
 def changelogs_without_any_releases_display_unreleased_normally(self):
     changelog = releases(self.f, self.b, skip_initial=True)
     # Ensure only the two unreleased 'releases' showed up
     eq_(len(changelog), 2)
     # And assert that both items appeared in one of them (since there's no
     # real releases at all, the bugfixes are treated as 'major' bugs, as
     # per concepts doc.)
     bugfix, feature = changelog
     eq_(len(feature['entries']), 2)
     eq_(len(bugfix['entries']), 0)
Beispiel #6
0
 def unreleased_items_go_in_unreleased_releases(self):
     changelog = releases(self.f, self.b)
     # Should have two unreleased lists, one feature w/ feature, one bugfix
     # w/ bugfix.
     bugfix, feature = changelog[1:]
     eq_(len(feature['entries']), 1)
     eq_(len(bugfix['entries']), 1)
     assert self.f in feature['entries']
     assert self.b in bugfix['entries']
     eq_(feature['obj'].number, 'unreleased_1.x_feature')
     eq_(bugfix['obj'].number, 'unreleased_1.x_bugfix')
Beispiel #7
0
 def oddly_ordered_bugfix_releases_and_unreleased_list(self):
     # Release set up w/ non-contiguous feature+bugfix releases; catches
     # funky problems with 'unreleased' buckets
     b2 = b(2)
     f3 = f(3)
     changelog = releases(
         '1.1.1', '1.0.2', self.f, b2, '1.1.0', f3, self.b
     )
     assert f3 in changelog[1]['entries']
     assert b2 in changelog[2]['entries']
     assert b2 in changelog[3]['entries']
Beispiel #8
0
 def all_bugs_before_first_release_act_featurelike(self):
     b1 = b(1)
     f2 = f(2)
     b3 = b(3)
     implicit = list_item('', paragraph('', '', raw('', 'whatever')))
     changelog = changelog2dict(
         releases('0.1.1', b3, '0.1.0', f2, b1, implicit,
                  skip_initial=True))
     first = changelog['0.1.0']
     second = changelog['0.1.1']
     assert b1 in first
     assert f2 in first
     eq_(len(first), 3)  # Meh, hard to assert about the implicit one
     eq_(second, [b3])
Beispiel #9
0
 def all_bugs_before_first_release_act_featurelike(self):
     b1 = b(1)
     f2 = f(2)
     b3 = b(3)
     implicit = list_item('', paragraph('', '', raw('', 'whatever')))
     changelog = changelog2dict(releases(
         '0.1.1', b3, '0.1.0', f2, b1, implicit,
         skip_initial=True
     ))
     first = changelog['0.1.0']
     second = changelog['0.1.1']
     assert b1 in first
     assert f2 in first
     eq_(len(first), 3) # Meh, hard to assert about the implicit one
     eq_(second, [b3])
Beispiel #10
0
    def issues_are_sorted_by_type_within_releases(self):
        b1 = b(123, major=True)
        b2 = b(124, major=True)
        s1 = s(25)
        s2 = s(26)
        f1 = f(3455)
        f2 = f(3456)

        # Semi random definitely-not-in-desired-order order
        changelog = changelog2dict(releases('1.1', b1, s1, s2, f1, b2, f2))

        # Order should be feature, bug, support. While it doesn't REALLY
        # matter, assert that within each category the order matches the old
        # 'reverse chronological' order.
        eq_(changelog['1.1'], [f2, f1, b2, b1, s2, s1])
Beispiel #11
0
 def _generate(self, *entries, **kwargs):
     raw = kwargs.pop('raw', False)
     nodes = construct_nodes(releases(*entries, **kwargs))
     # By default, yield the contents of the bullet list.
     return nodes if raw else nodes[0][1][0]
Beispiel #12
0
 def duplicate_zeroes_dont_error(self):
     cl = releases('1.0.1', b(0), b(0))
     cl = changelog2dict(cl)
     assert len(cl['1.0.1']) == 2
Beispiel #13
0
 def duplicate_issue_numbers_adds_two_issue_items(self):
     test_changelog = releases('1.0.1', self.b, self.b)
     test_changelog = changelog2dict(test_changelog)
     eq_(len(test_changelog['1.0.1']), 2)
Beispiel #14
0
 def issues_consumed_by_releases_are_not_in_unreleased(self):
     changelog = releases('1.0.2', self.f, self.b, self.s, self.bs)
     release = changelog[1]['entries']
     unreleased = changelog[-1]['entries']
     assert self.b in release
     assert self.b not in unreleased
Beispiel #15
0
 def _generate(self, *entries, **kwargs):
     raw = kwargs.pop("raw", False)
     nodes = construct_nodes(releases(*entries, **kwargs))
     # By default, yield the contents of the bullet list.
     return nodes if raw else nodes[0][1][0]
Beispiel #16
0
 def _generate(self, *entries, **kwargs):
     app = kwargs.get('app', None)
     nodes = construct_nodes(releases(*entries, app=app))
     # By default, yield the contents of the bullet list.
     return nodes if kwargs.get('raw', False) else nodes[0][1][0]