def test_check_link_should_work_with_https(): saving_zelda = SavingZelda(**zelda_args) saving_zelda.check_link("https://httpbin.org/status/200") assert {"https://httpbin.org/status/200": 200,} == saving_zelda.links_and_status
def test_check_link_should_cry_when_given_an_invalid_url(): saving_zelda = SavingZelda(**zelda_args) saving_zelda.check_link("http://this.url.does.not.have.a.valid.status.code.renatacarreira.com") assert {"http://this.url.does.not.have.a.valid.status.code.renatacarreira.com": "Nodename nor servname provided, or not known",} == saving_zelda.links_and_status
def test_check_link_should_append_link_and_status_for_a_valid_link(): saving_zelda = SavingZelda(**zelda_args) saving_zelda.check_link("http://httpbin.org/status/200") assert {"http://httpbin.org/status/200": 200,} == saving_zelda.links_and_status