Skip to content

Commit 29b7547

Browse files
committed
Rename from_url() to from_string() in GoogleCloudHealthcare.
1 parent e288e90 commit 29b7547

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/dicomweb_client/uri.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def from_string(cls,
450450

451451
@attr.s(frozen=True)
452452
class GoogleCloudHealthcare:
453-
"""Base URL helper for DICOM Stores under the `Google Cloud Healthcare API`_.
453+
"""Base URL container for DICOM Stores under the `Google Cloud Healthcare API`_.
454454
455455
This class facilitates the parsing and creation of :py:attr:`URI.base_url`
456456
corresponding to DICOMweb API Service URLs under the v1_ API. The URLs are
@@ -495,7 +495,7 @@ def __str__(self) -> str:
495495
f'dicomStores/{self.dicom_store_id}/dicomWeb')
496496

497497
@classmethod
498-
def from_url(cls, base_url: str) -> 'GoogleCloudHealthcare':
498+
def from_string(cls, base_url: str) -> 'GoogleCloudHealthcare':
499499
"""Creates an instance from ``base_url``.
500500
501501
Parameters

tests/test_uri.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,10 @@ def test_chc_invalid_dataset_or_store(name):
479479

480480

481481
@pytest.mark.parametrize('url', [f'{_CHC_API_URL}beta', 'https://some.url'])
482-
def test_chc_from_url_invalid_api(url):
483-
"""Tests for bad API URL error`GoogleCloudHealthcare.from_url()`."""
482+
def test_chc_from_string_invalid_api(url):
483+
"""Tests for bad API URL error`GoogleCloudHealthcare.from_string()`."""
484484
with pytest.raises(ValueError, match='v1 URL'):
485-
GoogleCloudHealthcare.from_url(url)
485+
GoogleCloudHealthcare.from_string(url)
486486

487487

488488
@pytest.mark.parametrize('url', [
@@ -497,15 +497,15 @@ def test_chc_from_url_invalid_api(url):
497497
f'{_CHC_API_URL}/projects/p/locations/l/datasets/d/dicomWeb',
498498
f'{_CHC_API_URL}/projects/p/locations/l//datasets/d/dicomStores/ds/dicomWeb'
499499
])
500-
def test_chc_from_url_invalid_store_name(url):
501-
"""Tests for bad Store name `GoogleCloudHealthcare.from_url()`."""
500+
def test_chc_from_string_invalid_store_name(url):
501+
"""Tests for bad Store name `GoogleCloudHealthcare.from_string()`."""
502502
with pytest.raises(ValueError, match='v1 DICOM'):
503-
GoogleCloudHealthcare.from_url(url)
503+
GoogleCloudHealthcare.from_string(url)
504504

505505

506-
def test_chc_from_url_success():
507-
"""Locks down `GoogleCloudHealthcare.from_url()`."""
508-
store = GoogleCloudHealthcare.from_url(_CHC_BASE_URL)
506+
def test_chc_from_string_success():
507+
"""Locks down `GoogleCloudHealthcare.from_string()`."""
508+
store = GoogleCloudHealthcare.from_string(_CHC_BASE_URL)
509509
assert store.project_id == _PROJECT_ID
510510
assert store.location == _LOCATION
511511
assert store.dataset_id == _DATASET_ID

0 commit comments

Comments
 (0)