test: fix pylint warnings for FunctionalTestCase
This commit is contained in:
parent
3af8e8aaf2
commit
53817a9e32
1 changed files with 9 additions and 5 deletions
|
|
@ -179,13 +179,17 @@ class VersionWebTestCase(WebTestCase):
|
||||||
@pytest.mark.functional
|
@pytest.mark.functional
|
||||||
class FunctionalTestCase(DataTestCase):
|
class FunctionalTestCase(DataTestCase):
|
||||||
"""
|
"""
|
||||||
Base class for test suites requiring a fully complete web app, to
|
Base class for test suites requiring a fully complete web app, for
|
||||||
respond to functional tests.
|
sake of functional tests.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
This class is very new and not yet mature; it will surely change.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
wsgi_main_app = None
|
wsgi_main_app = None
|
||||||
|
|
||||||
def make_config(self, **kwargs):
|
def make_config(self, **kwargs): # pylint: disable=arguments-differ
|
||||||
sqlite_path = self.write_file("test.sqlite", "")
|
sqlite_path = self.write_file("test.sqlite", "")
|
||||||
self.sqlite_engine_url = f"sqlite:///{sqlite_path}"
|
self.sqlite_engine_url = f"sqlite:///{sqlite_path}"
|
||||||
|
|
||||||
|
|
@ -203,14 +207,14 @@ version_locations = wuttjamaican.db:alembic/versions
|
||||||
|
|
||||||
return super().make_config([config_path], **kwargs)
|
return super().make_config([config_path], **kwargs)
|
||||||
|
|
||||||
def make_webtest(self):
|
def make_webtest(self): # pylint: disable=missing-function-docstring
|
||||||
webapp = appmod.make_wsgi_app(
|
webapp = appmod.make_wsgi_app(
|
||||||
self.wsgi_main_app or appmod.main, config=self.config
|
self.wsgi_main_app or appmod.main, config=self.config
|
||||||
)
|
)
|
||||||
|
|
||||||
return TestApp(webapp)
|
return TestApp(webapp)
|
||||||
|
|
||||||
def get_csrf_token(self, testapp):
|
def get_csrf_token(self, testapp): # pylint: disable=missing-function-docstring
|
||||||
res = testapp.get("/login")
|
res = testapp.get("/login")
|
||||||
match = re.search(
|
match = re.search(
|
||||||
r'<input name="_csrf" type="hidden" value="(\w+)" />', res.text
|
r'<input name="_csrf" type="hidden" value="(\w+)" />', res.text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue