def get_footer(last_updated: str = "") -> yattag.Doc: """Produces the end of the page.""" items = [] # type: List[yattag.Doc] doc = yattag.Doc() doc.text(_("Version: ")) doc.asis(util.git_link(version.VERSION, "https://github.com/vmiklos/osm-gimmisn/commit/").getvalue()) items.append(doc) items.append(util.html_escape(_("OSM data © OpenStreetMap contributors."))) if last_updated: items.append(util.html_escape(_("Last update: ") + last_updated)) doc = yattag.Doc() doc.stag("hr") with doc.tag("div"): for index, item in enumerate(items): if index: doc.text(" ¦ ") doc.asis(item.getvalue()) return doc
def test_happy(self) -> None: """Tests the happy path.""" actual = util.git_link("v1-151-g64ecc85", "http://www.example.com/").getvalue() expected = "<a href=\"http://www.example.com/64ecc85\">v1-151-g64ecc85</a>" self.assertEqual(actual, expected)