def test_httpsession_failure_reason_in_dict(self): session = HttpTrackerSession("localhost", ("localhost", 8475), "/announce", 5) session._infohash_list = [] session._process_scrape_response(bencode({'failure reason': 'test'})) self.assertTrue(session.is_failed)
def test_httpsession_bdecode_fails(self): session = HttpTrackerSession("localhost", ("localhost", 8475), "/announce", 5) session._infohash_list = [] session._process_scrape_response("test") self.assertTrue(session.is_failed)
def test_httpsession_bdecode_fails(self): session = HttpTrackerSession("localhost", ("localhost", 8475), "/announce", 5) session._infohash_list = [] session._process_scrape_response(bencode({})) self.assertTrue(session.is_failed)
def test_httpsession_failure_reason_in_dict(self): session = HttpTrackerSession("localhost", ("localhost", 8475), "/announce", 5) session._infohash_list = [] session._process_scrape_response(bencode({'failure reason': 'test'})) self.assertTrue(session.is_failed)
def test_httpsession_scrape_no_body(self): session = HttpTrackerSession("localhost", ("localhost", 8475), "/announce", 5) session._process_scrape_response(None) session._infohash_list = [] self.assertTrue(session.is_failed)