Skip to content

Commit

Permalink
Minor release testing updates
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Jan 9, 2024
1 parent a0683d8 commit 7913526
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tes/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ def send_request(
return response


def process_url(value):
return re.sub("[/]+$", "", value)


@attrs
class HTTPClient(object):
"""HTTP client class for interacting with the TES API."""
url: str = attrib(converter=process_url)
url: str = attrib(converter=process_url, validator=instance_of(str))
timeout: int = attrib(default=10, validator=instance_of(int))
user: Optional[str] = attrib(
default=None, converter=strconv, validator=optional(instance_of(str)))
Expand Down
2 changes: 0 additions & 2 deletions tes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ class _ListOfValidator(object):

type: Type = attrib()

def __call__(self, inst, attr, value):
"""We use a callable class to be able to change the ``__repr__``."""
def __call__(self, inst, attr, value) -> None:
"""We use a callable class to be able to change the ``__repr__``."""
if not all([isinstance(n, self.type) for n in value]):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TestHTTPClient(unittest.TestCase):

def test_cli(self):
cli = HTTPClient(url="http://fakehost:8000//", timeout=5)
self.assertEqual(cli.url, "http://fakehost:8000//")
self.assertEqual(cli.url, "http://fakehost:8000")
self.assertEqual(cli.urls, [
"http://fakehost:8000/ga4gh/tes/v1",
"http://fakehost:8000/v1",
Expand Down

0 comments on commit 7913526

Please sign in to comment.