def test_incap_session(): """ Unblock using the session wrapper. :return: """ sess = IncapSession() r = sess.get(target_url) return incap_blocked(r)
def test_blocked(): """ Check to make sure that the resource is blocked by incapsula. :return: """ r = session.get(target_url) with open('blocked.html', 'wb') as f: f.write(r.content) return incap_blocked(r)
def unblock(): """ Unblock the target url/session :return: """ r = session.get(target_url) r = crack(session, r) with open('unblocked.html', 'wb') as f: f.write(r.content) return incap_blocked(r)