예제 #1
0
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&lt;<' in html
예제 #2
0
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&lt;<" in html
예제 #3
0
 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
예제 #4
0
 def get_building_links_html(self) -> str:
     return Hyperlink.join_admin_buttons(self.building_links)
예제 #5
0
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>'
    )
예제 #6
0
def test_join_admin_buttons_returns_nothing_on_empty_list():
    assert Hyperlink.join_admin_buttons([]) == ""