Example #1
0
 def explicit_releases_error_on_unfound_issues(self):
     # Just a release - result will have 1.0.0, 1.0.1, and unreleased
     changelog = _release_list('1.0.1')
     # No issues listed -> this clearly doesn't exist in any buckets
     changelog[1][0].append(Text("25"))
     # This should asplode
     construct_releases(changelog, _app())
Example #2
0
 def explicit_releases_error_on_unfound_issues(self):
     # Just a release - result will have 1.0.0, 1.0.1, and unreleased
     changelog = release_list('1.0.1')
     # No issues listed -> this clearly doesn't exist in any buckets
     changelog[1][0].append(Text("25"))
     # This should asplode
     construct_releases(changelog, make_app())
Example #3
0
def _releases(*entries):
    entries = list(entries) # lol tuples
    # Translate simple objs into changelog-friendly ones
    for index, item in enumerate(entries):
        if isinstance(item, six.string_types):
            entries[index] = _release(item)
        else:
            entries[index] = _entry(item)
    # Insert initial/empty 1st release to start timeline
    entries.append(_release('1.0.0'))
    return construct_releases(entries, _app())
Example #4
0
 def explicit_bugfix_releases_get_removed_from_unreleased(self):
     b1 = b(1)
     b2 = b(2)
     changelog = release_list('1.0.1', b1, b2)
     # Ensure that 1.0.1 specifies bug 2
     changelog[0][0].append(Text('2'))
     rendered, _ = construct_releases(changelog, make_app())
     # 1.0.1 should have bug 2 only
     assert b2 in rendered[1]['entries']
     assert b1 not in rendered[1]['entries']
     # unreleased bug list should still get/see bug 1
     assert b1 in rendered[2]['entries']
Example #5
0
 def explicit_bugfix_releases_get_removed_from_unreleased(self):
     b1 = _issue('bug', '1')
     b2 = _issue('bug', '2')
     changelog = _release_list('1.0.1', b1, b2)
     # Ensure that 1.0.1 specifies bug 2
     changelog[0][0].append(Text('2'))
     rendered = construct_releases(changelog, _app())
     # 1.0.1 should have bug 2 only
     assert b2 in rendered[1]['entries']
     assert b1 not in rendered[1]['entries']
     # unreleased bug list should still get/see bug 1
     assert b1 in rendered[2]['entries']
Example #6
0
 def explicit_feature_release_features_are_removed_from_unreleased(self):
     f1 = _issue('feature', '1')
     f2 = _issue('feature', '2')
     changelog = _release_list('1.1.0', f1, f2)
     # Ensure that 1.1.0 specifies feature 2
     changelog[0][0].append(Text("2"))
     rendered = _changelog2dict(construct_releases(changelog, _app()))
     # 1.1.0 should have feature 2 only
     assert f2 in rendered['1.1.0']
     assert f1 not in rendered['1.1.0']
     # unreleased feature list should still get/see feature 1
     assert f1 in rendered['unreleased_feature']
     # now-released feature 2 should not be in unreleased_feature
     assert f2 not in rendered['unreleased_feature']
Example #7
0
 def explicit_feature_release_features_are_removed_from_unreleased(self):
     f1 = f(1)
     f2 = f(2)
     changelog = release_list('1.1.0', f1, f2)
     # Ensure that 1.1.0 specifies feature 2
     changelog[0][0].append(Text("2"))
     rendered = changelog2dict(construct_releases(changelog, make_app())[0])
     # 1.1.0 should have feature 2 only
     assert f2 in rendered['1.1.0']
     assert f1 not in rendered['1.1.0']
     # unreleased feature list should still get/see feature 1
     assert f1 in rendered['unreleased_1.x_feature']
     # now-released feature 2 should not be in unreleased_feature
     assert f2 not in rendered['unreleased_1.x_feature']
Example #8
0
 def _test_link(self, kwargs, type_, expected):
     app = _app(**kwargs)
     nodes = construct_nodes(
         construct_releases(
             [_release("1.0.2", app=app), _entry(_issue("bug", 15, app=app)), _release("1.0.0")], app=app
         )
     )
     if type_ == "release":
         header = nodes[0][0][0].astext()
         assert expected in header
     elif type_ == "issue":
         link = nodes[0][1][0][0][2]
         eq_(link["refuri"], expected)
     else:
         raise Exception("Gave unknown type_ kwarg to _test_link()!")
Example #9
0
 def _test_link(self, kwargs, type_, expected):
     app = make_app(**kwargs)
     nodes = construct_nodes(construct_releases([
         release('1.0.2', app=app),
         entry(b(15, app=app)),
         release('1.0.0'),
     ], app=app))
     if type_ == 'release':
         header = nodes[0][0][0].astext()
         assert expected in header
     elif type_ == 'issue':
         link = nodes[0][1][0][0][2]
         eq_(link['refuri'], expected)
     else:
         raise Exception("Gave unknown type_ kwarg to _test_link()!")
Example #10
0
 def _test_link(self, kwargs, type_, expected):
     app = _app(**kwargs)
     nodes = construct_nodes(construct_releases([
         _release('1.0.2', app=app),
         _entry(_issue('bug', 15, app=app)),
         _release('1.0.0'),
     ], app=app))
     if type_ == 'release':
         header = nodes[0][0][0].astext()
         assert expected in header
     elif type_ == 'issue':
         link = nodes[0][1][0][0][2]
         eq_(link['refuri'], expected)
     else:
         raise Exception("Gave unknown type_ kwarg to _test_link()!")
Example #11
0
 def releases_can_specify_issues_explicitly(self):
     # Build regular list-o-entries
     b2 = _issue("bug", "2")
     b3 = _issue("bug", "3")
     changelog = _release_list("1.0.1", "1.1.1", b3, b2, self.b, "1.1.0", self.f)
     # Modify 1.0.1 release to be speshul
     changelog[0][0].append(Text("2, 3"))
     rendered = construct_releases(changelog, _app())
     # 1.0.1 includes just 2 and 3, not bug 1
     one_0_1 = rendered[3]["entries"]
     one_1_1 = rendered[2]["entries"]
     assert self.b not in one_0_1
     assert b2 in one_0_1
     assert b3 in one_0_1
     # 1.1.1 includes all 3 (i.e. the explicitness of 1.0.1 didn't affect
     # the 1.1 line bucket.)
     assert self.b in one_1_1
     assert b2 in one_1_1
     assert b3 in one_1_1
Example #12
0
 def _test_link(self, kwargs, type_, expected):
     app = make_app(**kwargs)
     nodes = construct_nodes(
         construct_releases([
             release('1.0.2', app=app),
             entry(b(15, app=app)),
             release('1.0.0'),
         ],
                            app=app)[0])
     # Shorthand for "I'll do my own asserts"
     if expected is None:
         return nodes
     if type_ == 'release':
         header = nodes[0][0][0].astext()
         assert expected in header
     elif type_ == 'issue':
         link = nodes[0][1][0][0][2]
         eq_(link['refuri'], expected)
     else:
         raise Exception("Gave unknown type_ kwarg to _test_link()!")
Example #13
0
 def releases_can_specify_issues_explicitly(self):
     # Build regular list-o-entries
     b2 = _issue('bug', '2')
     b3 = _issue('bug', '3')
     changelog = _release_list('1.0.1', '1.1.1', b3, b2, self.b, '1.1.0',
                               self.f)
     # Modify 1.0.1 release to be speshul
     changelog[0][0].append(Text("2, 3"))
     rendered = construct_releases(changelog, _app())
     # 1.0.1 includes just 2 and 3, not bug 1
     one_0_1 = rendered[3]['entries']
     one_1_1 = rendered[2]['entries']
     assert self.b not in one_0_1
     assert b2 in one_0_1
     assert b3 in one_0_1
     # 1.1.1 includes all 3 (i.e. the explicitness of 1.0.1 didn't affect
     # the 1.1 line bucket.)
     assert self.b in one_1_1
     assert b2 in one_1_1
     assert b3 in one_1_1
Example #14
0
 def releases_can_specify_issues_explicitly(self):
     # Build regular list-o-entries
     b2 = b(2)
     b3 = b(3)
     changelog = release_list(
         '1.0.1', '1.1.1', b3, b2, self.b, '1.1.0', self.f
     )
     # Modify 1.0.1 release to be speshul
     changelog[0][0].append(Text("2, 3"))
     rendered, _ = construct_releases(changelog, make_app())
     # 1.0.1 includes just 2 and 3, not bug 1
     one_0_1 = rendered[3]['entries']
     one_1_1 = rendered[2]['entries']
     assert self.b not in one_0_1
     assert b2 in one_0_1
     assert b3 in one_0_1
     # 1.1.1 includes all 3 (i.e. the explicitness of 1.0.1 didn't affect
     # the 1.1 line bucket.)
     assert self.b in one_1_1
     assert b2 in one_1_1
     assert b3 in one_1_1
Example #15
0
 def _test_link(self, kwargs, type_, expected):
     app = make_app(**kwargs)
     nodes = construct_nodes(
         construct_releases(
             [
                 release("1.0.2", app=app),
                 entry(b(15, app=app)),
                 release("1.0.0"),
             ],
             app=app,
         )[0])
     # Shorthand for "I'll do my own asserts"
     if expected is None:
         return nodes
     if type_ == "release":
         header = nodes[0][0][0].astext()
         assert expected in header
     elif type_ == "issue":
         link = nodes[0][1][0][0][2]
         assert link["refuri"] == expected
     else:
         raise Exception("Gave unknown type_ kwarg to _test_link()!")
Example #16
0
def _releases(*entries):
    return construct_releases(_release_list(*entries), _app())
Example #17
0
def releases(*entries, **kwargs):
    app = kwargs.pop('app', None) or make_app()
    return construct_releases(release_list(*entries, **kwargs), app)
Example #18
0
def _releases(*entries, **kwargs):
    app = kwargs.get('app', None) or _app()
    return construct_releases(_release_list(*entries), app)
Example #19
0
def releases(*entries, **kwargs):
    app = kwargs.pop("app", None) or make_app()
    return construct_releases(release_list(*entries, **kwargs), app)[0]
Example #20
0
 def explicit_release_list_split_works_with_unicode(self):
     b = _issue('bug', '17')
     changelog = _release_list('1.0.1', b)
     changelog[0][0].append(Text(six.text_type('17')))
     # When using naive method calls, this explodes
     construct_releases(changelog, _app())
Example #21
0
def _releases(*entries, **kwargs):
    app = kwargs.get("app", None) or _app()
    return construct_releases(_release_list(*entries), app)
Example #22
0
 def explicit_release_list_split_works_with_unicode(self):
     changelog = release_list('1.0.1', b(17))
     changelog[0][0].append(Text(six.text_type('17')))
     # When using naive method calls, this explodes
     construct_releases(changelog, make_app())