def test_CheckURI_good(): '''The CheckURI code should return True for a good URI.''' print("Testing CheckURI function for a good URI.") from BookmarkServer import CheckURI try: good = CheckURI("https://www.google.com/") except NotImplementedError: return ("CheckURI raised NotImplementedError.\n" "Do step 1, and make sure to remove the 'raise' line.") if good is not True: return ("CheckURI returned {} on a good URI instead of True.\n" "(Or maybe Google is down.)".format(good)) else: print("CheckURI correctly tested a good URI.") return None
def test_CheckURI_bad(): '''The CheckURI code should return False for a bad URI.''' print("Testing CheckURI function for a bad URI.") from BookmarkServer import CheckURI try: bad = CheckURI("this is a bad uri") except NotImplementedError: return ("CheckURI raised NotImplementedError.\n" "Do step 1, and make sure to remove the 'raise' line.") if bad is not False: return ( "CheckURI returned {} on a bad URI instead of False.".format(bad)) else: print("CheckURI correctly tested a bad URI.") return None