Skip to content

Commit f89e3c6

Browse files
committed
TST: test for communication with save-restore
1 parent 08b4f35 commit f89e3c6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/save_and_restore_api/tools/upload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def ROOT_NODE_UID(self):
2929

3030
def open(self):
3131
auth = httpx.BasicAuth(username=self._username, password=self._password)
32-
self._client = httpx.Client(base_url=BASE_URL, timeout=timeout, auth=auth)
32+
self._client = httpx.Client(base_url=self._base_url, timeout=timeout, auth=auth)
3333

3434
def close(self):
3535
self._client.close()

tests/test_package.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import importlib.metadata
44

55
import save_and_restore_api as m
6+
from save_and_restore_api.tools.upload import SaveRestoreAPI
67

78

89
def test_version():
@@ -11,3 +12,14 @@ def test_version():
1112

1213
def test_import():
1314
from save_and_restore_api.tools.upload import SaveRestoreAPI # noqa: F401
15+
16+
17+
def test_comm():
18+
SR = SaveRestoreAPI(base_url="http://localhost:8080/save-restore", timeout=2)
19+
# SR.set_username_password(username="johndoe", password="1234")
20+
SR.set_username_password(username="user", password="userPass")
21+
# SR.set_username_password(username="admin", password="adminPass")
22+
SR.open()
23+
SR.login()
24+
SR.get_node(SR.ROOT_NODE_UID)
25+
SR.close()

0 commit comments

Comments
 (0)