Skip to content

Commit 9228a06

Browse files
Use variable name 'client' for test_client instances
1 parent c789840 commit 9228a06

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/moin/apps/admin/_tests/test_admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
),
2626
)
2727
def test_admin(app, url_for_args, status, data):
28-
with app.test_client() as c:
29-
rv = c.get(url_for(**url_for_args))
28+
with app.test_client() as client:
29+
rv = client.get(url_for(**url_for_args))
3030
assert rv.status == status
3131
assert rv.headers["Content-Type"] == "text/html; charset=utf-8"
3232
for item in data:

src/moin/apps/feed/_tests/test_feed.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
class TestFeeds:
1515
def test_global_atom(self, app):
16-
with app.test_client() as c:
17-
rv = c.get(url_for("feed.atom"))
16+
with app.test_client() as client:
17+
rv = client.get(url_for("feed.atom"))
1818
assert rv.status == "200 OK"
1919
assert rv.headers["Content-Type"] == "application/atom+xml"
2020
assert rv.data.startswith(b"<?xml")
@@ -24,17 +24,17 @@ def test_global_atom(self, app):
2424
def test_global_atom_with_an_item(self, app):
2525
basename = "Foo"
2626
update_item(basename, {COMMENT: "foo data for feed item"}, "")
27-
with app.test_client() as c:
28-
rv = c.get(url_for("feed.atom"))
27+
with app.test_client() as client:
28+
rv = client.get(url_for("feed.atom"))
2929
assert rv.status == "200 OK"
3030
assert rv.headers["Content-Type"] == "application/atom+xml"
3131
assert rv.data.startswith(b"<?xml")
3232
assert b"foo data for feed item" in rv.data
3333

3434
# Test cache invalidation
3535
update_item(basename, {COMMENT: "checking if the cache invalidation works"}, "")
36-
with app.test_client() as c:
37-
rv = c.get(url_for("feed.atom"))
36+
with app.test_client() as client:
37+
rv = client.get(url_for("feed.atom"))
3838
assert rv.status == "200 OK"
3939
assert rv.headers["Content-Type"] == "application/atom+xml"
4040
assert rv.data.startswith(b"<?xml")

src/moin/apps/frontend/_tests/test_frontend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def _test_view(
3737
if params is None:
3838
params = {}
3939

40-
with self.app.test_client() as c:
40+
with self.app.test_client() as client:
4141
for method in ["HEAD", "GET"]:
4242
print("%s %s" % (method, url_for(viewname, **viewopts)))
43-
rv = c.open(url_for(viewname, **viewopts), method=method, data=params)
43+
rv = client.open(url_for(viewname, **viewopts), method=method, data=params)
4444
rv_data = rv.data.decode()
4545
assert rv.status == status
4646
assert rv.headers["Content-Type"] in content_types
@@ -63,8 +63,8 @@ def _test_view_post(
6363
if form is None:
6464
form = {}
6565
print("POST %s" % url_for(viewname, **viewopts))
66-
with self.app.test_client() as c:
67-
rv = c.post(url_for(viewname, **viewopts), data=form)
66+
with self.app.test_client() as client:
67+
rv = client.post(url_for(viewname, **viewopts), data=form)
6868
rv_data = rv.data.decode()
6969
assert rv.status == status
7070
assert rv.headers["Content-Type"] in content_types

src/moin/apps/misc/_tests/test_misc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
class TestMisc:
1212
def test_global_sitemap(self, app):
13-
with app.test_client() as c:
14-
rv = c.get(url_for("misc.sitemap"))
13+
with app.test_client() as client:
14+
rv = client.get(url_for("misc.sitemap"))
1515
assert rv.status == "200 OK"
1616
assert rv.headers["Content-Type"] == "text/xml; charset=utf-8"
1717
assert rv.data.startswith(b"<?xml")
1818
assert b'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' in rv.data
1919
assert b"</urlset>" in rv.data
2020

2121
def test_urls_names(self, app):
22-
with app.test_client() as c:
23-
rv = c.get(url_for("misc.urls_names"))
22+
with app.test_client() as client:
23+
rv = client.get(url_for("misc.urls_names"))
2424
assert rv.status == "200 OK"
2525
assert rv.headers["Content-Type"] == "text/plain; charset=utf-8"

src/moin/apps/serve/_tests/test_serve.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
class TestServe:
1212
def test_index(self, app):
13-
with app.test_client() as c:
14-
rv = c.get(url_for("serve.index"))
13+
with app.test_client() as client:
14+
rv = client.get(url_for("serve.index"))
1515
assert rv.status == "200 OK"
1616
assert rv.headers["Content-Type"] == "text/plain"
1717

1818
def test_files(self, app):
19-
with app.test_client() as c:
20-
rv = c.get(url_for("serve.files", name="DoesntExist"))
19+
with app.test_client() as client:
20+
rv = client.get(url_for("serve.files", name="DoesntExist"))
2121
assert rv.status == "404 NOT FOUND"
2222
assert rv.headers["Content-Type"] == "text/html; charset=utf-8"
2323
assert rv.text.startswith("<!doctype html")

src/moin/items/_tests/test_Blog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def set_self_app(self, app):
2727
self.app = app
2828

2929
def _test_view(self, item_name, req_args={}, data_tokens=[], exclude_data_tokens=[], regex=None):
30-
with self.app.test_client() as c:
31-
rv = c.get(url_for("frontend.show_item", item_name=item_name, **req_args))
30+
with self.app.test_client() as client:
31+
rv = client.get(url_for("frontend.show_item", item_name=item_name, **req_args))
3232
rv_data = rv.data.decode()
3333
for data in data_tokens:
3434
assert data in rv_data

0 commit comments

Comments
 (0)