From 206f0fe0b97610fc371ad0acdd5146ac12eacfe7 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Mon, 9 Oct 2023 13:50:30 -0700 Subject: Style cleanup --- tests/test_dl.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'tests/test_dl.py') diff --git a/tests/test_dl.py b/tests/test_dl.py index 396041d..abf8763 100644 --- a/tests/test_dl.py +++ b/tests/test_dl.py @@ -15,13 +15,10 @@ # You should have received a copy of the GNU General Public License # along with Wikiget. If not, see . -# import logging import pytest -# from wikiget import USER_AGENT -from wikiget.wikiget import construct_parser -# from wikiget.dl import get_dest, query_api, prep_download from wikiget.dl import get_dest +from wikiget.wikiget import construct_parser class TestGetDest: @@ -35,9 +32,11 @@ class TestGetDest: assert site_name == "commons.wikimedia.org" def test_get_dest_with_url(self): - args = self.parser.parse_args([ - "https://en.wikipedia.org/wiki/File:Example.jpg", - ]) + args = self.parser.parse_args( + [ + "https://en.wikipedia.org/wiki/File:Example.jpg", + ] + ) filename, dest, site_name = get_dest(args.FILE, args) assert filename == "Example.jpg" assert dest == "Example.jpg" @@ -48,12 +47,14 @@ class TestGetDest: with pytest.raises(SystemExit): filename, dest, site_name = get_dest(args.FILE, args) - def test_get_dest_with_different_site(self, caplog): - args = self.parser.parse_args([ - "https://commons.wikimedia.org/wiki/File:Example.jpg", - "--site", - "commons.wikimedia.org", - ]) + def test_get_dest_with_different_site(self, caplog: pytest.LogCaptureFixture): + args = self.parser.parse_args( + [ + "https://commons.wikimedia.org/wiki/File:Example.jpg", + "--site", + "commons.wikimedia.org", + ] + ) filename, dest, site_name = get_dest(args.FILE, args) assert "target is a URL, ignoring site specified with --site" in caplog.text -- cgit v1.2.3