diff options
| author | Cody Logan <clpo13@gmail.com> | 2023-10-09 13:50:30 -0700 |
|---|---|---|
| committer | Cody Logan <clpo13@gmail.com> | 2023-10-09 13:50:30 -0700 |
| commit | 206f0fe0b97610fc371ad0acdd5146ac12eacfe7 (patch) | |
| tree | e292b0b4ab95bf6d10539e2a0ec8d4c284ff1f1f /tests | |
| parent | 8e6bb3dcc1c929327425750057c411192c1e69d7 (diff) | |
| download | wikiget-206f0fe0b97610fc371ad0acdd5146ac12eacfe7.tar.gz wikiget-206f0fe0b97610fc371ad0acdd5146ac12eacfe7.zip | |
Style cleanup
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dl.py | 27 |
1 files changed, 14 insertions, 13 deletions
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 <https://www.gnu.org/licenses/>. -# 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 |
