def test_bad_url(self): """Bad URLs should return... an error!""" self.assertEqual(p.get_page_title("http://asdfasdfasdfasdfasdf/asdfasdfasdf"), "Bad URL! Title not retrieved")
def test_no_title(self): """Sites (or resources) with no <title> set should return empty string""" self.assertEqual(p.get_page_title("http://nostarch.com/sites/default/files/wabi_logo.png"), "")
def test_http_error(self): """HTTP errors should return... an error!""" self.assertEqual(p.get_page_title("http://nostarch.com/asdfasdfasdf"), "HTTP error! Title not retrieved")
def test_good_page_titles(self): """Sites with titles should be returned properly""" self.assertEqual(p.get_page_title("http://nostarch.com"), "No Starch Press") self.assertEqual(p.get_page_title("http://google.com"), "Google")