def test_join_admin_buttons_works(): html = Hyperlink.join_admin_buttons([ Hyperlink('bop', 'https://thing'), Hyperlink('glop<', 'https://blarg'), ]) assert '>bop<' in html assert '>glop<<' in html
def test_join_admin_buttons_works(): html = Hyperlink.join_admin_buttons( [ Hyperlink("bop", "https://thing"), Hyperlink("glop<", "https://blarg"), ] ) assert ">bop<" in html assert ">glop<<" in html
def building_links(self) -> List[Hyperlink]: links: List[Hyperlink] = [] if self.pad_bbl: links.append( Hyperlink( name="Who Owns What", url=f"https://whoownswhat.justfix.nyc/bbl/{self.pad_bbl}")) if self.pad_bin: links.append( Hyperlink( name="NYC DOB BIS", url= (f"http://a810-bisweb.nyc.gov/bisweb/PropertyProfileOverviewServlet?" f"bin={self.pad_bin}&go4=+GO+&requestid=0"))) return links
def get_building_links_html(self) -> str: return Hyperlink.join_admin_buttons(self.building_links)
def test_admin_button_url_works(): h = Hyperlink("boop", "http://blarg") assert h.admin_button_html == ( '<a href="http://blarg" class="button" target="blank" rel="nofollow noopener">boop</a>' )
def test_join_admin_buttons_returns_nothing_on_empty_list(): assert Hyperlink.join_admin_buttons([]) == ""