Skip to content

Commit af1dc0f

Browse files
committed
Network tests have been migrated to new cat2.cloud/testing site
1 parent ecbcb75 commit af1dc0f

8 files changed

Lines changed: 10 additions & 22 deletions

File tree

src/blosc2/c2array.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ def info(path, urlbase, params=None, headers=None, model=None, auth_token=None):
144144
return json if model is None else model(**json)
145145

146146

147-
def subscribe(root, urlbase, auth_token):
148-
url = _sub_url(urlbase, f"api/subscribe/{root}")
149-
return _xpost(url, auth_token=auth_token)
150-
151-
152147
def fetch_data(path, urlbase, params, auth_token=None, as_blosc2=False):
153148
url = _sub_url(urlbase, f"api/fetch/{path}")
154149
response = _xget(url, params=params, auth_token=auth_token)
@@ -237,15 +232,8 @@ def __init__(self, path: str, /, urlbase: str | None = None, auth_token: str | N
237232
# Try to 'open' the remote path
238233
try:
239234
self.meta = info(self.path, self.urlbase, auth_token=self.auth_token)
240-
except requests.HTTPError:
241-
# Subscribe to root and try again. It is less latency to subscribe directly
242-
# than to check for the subscription.
243-
root, _ = self.path.split("/", 1)
244-
subscribe(root, self.urlbase, self.auth_token)
245-
try:
246-
self.meta = info(self.path, self.urlbase, auth_token=self.auth_token)
247-
except requests.HTTPError as err:
248-
raise FileNotFoundError(f"Remote path not found: {path}.\nError was: {err}") from err
235+
except requests.HTTPError as err:
236+
raise FileNotFoundError(f"Remote path not found: {path}.\nError was: {err}") from err
249237
cparams = self.meta["schunk"]["cparams"]
250238
# Remove "filters, meta" from cparams; this is an artifact from the server
251239
cparams.pop("filters, meta", None)

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def pytest_configure(config):
2020
def c2sub_context():
2121
# You may use the URL and credentials for an already existing user
2222
# in a different Caterva2 subscriber.
23-
urlbase = os.environ.get("BLOSC_C2URLBASE", "https://demo.caterva2.net/")
23+
urlbase = os.environ.get("BLOSC_C2URLBASE", "https://cat2.cloud/testing/")
2424
c2params = {"urlbase": urlbase, "username": None, "password": None}
2525
with blosc2.c2context(**c2params):
2626
yield c2params

tests/ndarray/test_c2array_expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
pytestmark = pytest.mark.network
1717

1818
NITEMS_SMALL = 1_000
19-
ROOT = "b2tests"
19+
ROOT = "@public"
2020
DIR = "expr/"
2121

2222

tests/ndarray/test_c2array_reductions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
pytestmark = pytest.mark.network
1717

1818
NITEMS_SMALL = 1_000
19-
ROOT = "b2tests"
19+
ROOT = "@public"
2020
DIR = "expr/"
2121

2222

tests/ndarray/test_c2array_udf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import blosc2
1414

15-
ROOT = "b2tests"
15+
ROOT = "@public"
1616
DIR = "expr/"
1717

1818
pytestmark = pytest.mark.network

tests/ndarray/test_proxy_c2array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
pytestmark = pytest.mark.network
1616

1717
NITEMS_SMALL = 1_000
18-
ROOT = "b2tests"
18+
ROOT = "@public"
1919
DIR = "expr/"
2020

2121

tests/ndarray/test_proxy_expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
pytestmark = pytest.mark.network
1717

18-
ROOT = "b2tests"
18+
ROOT = "@public"
1919
DIR = "expr/"
2020

2121

tests/test_open_c2array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
pytestmark = pytest.mark.network
1919

2020
NITEMS_SMALL = 1_000
21-
ROOT = "b2tests"
21+
ROOT = "@public"
2222
DIR = "expr/"
2323

2424

@@ -71,7 +71,7 @@ def c2sub_user():
7171
def rand32():
7272
return random.randint(0, 0x7FFFFFFF)
7373

74-
urlbase = "https://demo-auth.caterva2.net/"
74+
urlbase = "https://cat2.cloud/testing/"
7575
username = f"user+{rand32():x}@example.com"
7676
password = hex(rand32())
7777

0 commit comments

Comments
 (0)