Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
wimglenn committed Mar 14, 2024
1 parent d1f75de commit 04b2a80
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 6 additions & 3 deletions luddite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals, print_function
from __future__ import print_function
from __future__ import unicode_literals

import argparse
import json
Expand All @@ -9,8 +10,10 @@
import sys
from concurrent.futures import ThreadPoolExecutor

from packaging.requirements import Requirement, InvalidRequirement
from packaging.version import Version, InvalidVersion
from packaging.requirements import InvalidRequirement
from packaging.requirements import Requirement
from packaging.version import InvalidVersion
from packaging.version import Version

try:
from urllib2 import Request, urlopen
Expand Down
12 changes: 10 additions & 2 deletions test_luddite.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ def test_parse_reqs_file_with_index(tmpdir):

def test_parse_reqs_file_with_two_indices(tmpdir):
reqs = tmpdir.join("reqs.txt")
reqs.write("-i http://myindex\n--index-url=http://anotherindexwtf\nabc==1.0\ndef==2.0")
reqs.write(
"-i http://myindex\n"
"--index-url=http://anotherindexwtf\n"
"abc==1.0\n"
"def==2.0"
)
file = luddite.RequirementsFile(reqs)
with pytest.raises(luddite.MultipleIndicesError):
file.index
Expand Down Expand Up @@ -183,7 +188,10 @@ def test_guess_index_type_pypi(mocker):
def test_guess_index_type_devpi(mocker):
mock_response = mocker.MagicMock()
mock_response.code = 200
mock_response.headers = {"Content-type": "awesomesauce", "X-Devpi-Server-Version": "4.0.0\r\n"}
mock_response.headers = {
"Content-type": "awesomesauce",
"X-Devpi-Server-Version": "4.0.0\r\n",
}
mocker.patch("luddite.urlopen", return_value=mock_response)
assert luddite.guess_index_type("http://test-index/") == "devpi"

Expand Down

0 comments on commit 04b2a80

Please sign in to comment.