mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-20 12:21:53 +00:00
Rename htmlutil.formsearch to htmlutil.loginformsearch
Make it clear that this module has only one specific use.
This commit is contained in:
parent
350f8bfef9
commit
7a6ef938cc
3 changed files with 7 additions and 7 deletions
|
|
@ -33,7 +33,7 @@ import random
|
|||
from .. import log, LOG_CHECK, strformat, LinkCheckerError
|
||||
from ..decorators import synchronized
|
||||
from ..cache import urlqueue
|
||||
from ..htmlutil import formsearch
|
||||
from ..htmlutil import loginformsearch
|
||||
from ..cookies import from_file
|
||||
from . import logger, status, checker, interrupt
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ class Aggregate (object):
|
|||
response = session.get(url)
|
||||
cgiuser = self.config["loginuserfield"]
|
||||
cgipassword = self.config["loginpasswordfield"]
|
||||
form = formsearch.search_form(response.text, cgiuser, cgipassword)
|
||||
form = loginformsearch.search_form(response.text, cgiuser, cgipassword)
|
||||
form.data[cgiuser] = user
|
||||
form.data[cgipassword] = password
|
||||
for key, value in self.config["loginextrafields"].items():
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Test login form functions.
|
|||
|
||||
import unittest
|
||||
|
||||
from linkcheck.htmlutil import formsearch
|
||||
from linkcheck.htmlutil import loginformsearch
|
||||
|
||||
login_form = """
|
||||
<html>
|
||||
|
|
@ -42,14 +42,14 @@ class TestFormSearch(unittest.TestCase):
|
|||
"""Test processing of a login form."""
|
||||
|
||||
def test_search_form(self):
|
||||
form = formsearch.search_form(login_form,
|
||||
"USER_FIELD", "password_field")
|
||||
form = loginformsearch.search_form(login_form,
|
||||
"USER_FIELD", "password_field")
|
||||
self.assertIsNotNone(form)
|
||||
self.assertEqual(form.url, "/log_me_in")
|
||||
self.assertIn("User_Field", form.data)
|
||||
self.assertIn("Password_Field", form.data)
|
||||
|
||||
def test_search_form_none(self):
|
||||
form = formsearch.search_form(login_form,
|
||||
"nouser", "nopassword")
|
||||
form = loginformsearch.search_form(login_form,
|
||||
"nouser", "nopassword")
|
||||
self.assertIsNone(form)
|
||||
Loading…
Reference in a new issue