Exemplo n.º 1
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()!")
Exemplo n.º 2
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()!")
Exemplo n.º 3
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()!")
Exemplo n.º 4
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()!")
Exemplo n.º 5
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()!")
Exemplo n.º 6
0
 def _generate(self, *entries, **kwargs):
     nodes = construct_nodes(_releases(*entries))
     # By default, yield the contents of the bullet list.
     return nodes if kwargs.get('raw', False) else nodes[0][1][0]
Exemplo n.º 7
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]
Exemplo n.º 8
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]
Exemplo n.º 9
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]